mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-22 21:59:37 +08:00

So that if you disable the plug-in, the MIME type declaration is also not added. Fixes #4151.
39 lines
1.0 KiB
Python
39 lines
1.0 KiB
Python
#Copyright (c) 2018 Ultimaker B.V.
|
|
#Cura is released under the terms of the LGPLv3 or higher.
|
|
|
|
import sys
|
|
|
|
from UM.Logger import Logger
|
|
try:
|
|
from . import UFPWriter
|
|
except ImportError:
|
|
Logger.log("w", "Could not import UFPWriter; libCharon may be missing")
|
|
|
|
from UM.i18n import i18nCatalog #To translate the file format description.
|
|
from UM.Mesh.MeshWriter import MeshWriter #For the binary mode flag.
|
|
|
|
i18n_catalog = i18nCatalog("cura")
|
|
|
|
def getMetaData():
|
|
if "UFPWriter.UFPWriter" not in sys.modules:
|
|
return {}
|
|
|
|
return {
|
|
"mesh_writer": {
|
|
"output": [
|
|
{
|
|
"mime_type": "application/x-ufp",
|
|
"mode": MeshWriter.OutputMode.BinaryMode,
|
|
"extension": "ufp",
|
|
"description": i18n_catalog.i18nc("@item:inlistbox", "Ultimaker Format Package")
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
def register(app):
|
|
if "UFPWriter.UFPWriter" not in sys.modules:
|
|
return {}
|
|
|
|
return { "mesh_writer": UFPWriter.UFPWriter() }
|