__init__.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright (c) 2015 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from typing import Dict
  4. import sys
  5. from UM.Logger import Logger
  6. try:
  7. from . import ThreeMFReader
  8. except ImportError:
  9. Logger.log("w", "Could not import ThreeMFReader; libSavitar may be missing")
  10. from . import ThreeMFWorkspaceReader
  11. from UM.i18n import i18nCatalog
  12. catalog = i18nCatalog("cura")
  13. def getMetaData() -> Dict:
  14. workspace_extension = "3mf"
  15. metaData = {}
  16. if "3MFReader.ThreeMFReader" in sys.modules:
  17. metaData["mesh_reader"] = [
  18. {
  19. "extension": "3mf",
  20. "description": catalog.i18nc("@item:inlistbox", "3MF File")
  21. }
  22. ]
  23. metaData["workspace_reader"] = [
  24. {
  25. "extension": workspace_extension,
  26. "description": catalog.i18nc("@item:inlistbox", "3MF File")
  27. }
  28. ]
  29. return metaData
  30. def register(app):
  31. if "3MFReader.ThreeMFReader" in sys.modules:
  32. return {"mesh_reader": ThreeMFReader.ThreeMFReader(),
  33. "workspace_reader": ThreeMFWorkspaceReader.ThreeMFWorkspaceReader()}
  34. else:
  35. return {}