mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-11 16:00:47 -07:00
Merge pull request #3236 from fieldOfView/fix_ufp_import_failure
Gracefully handle missing libCharon
This commit is contained in:
commit
2d9f9c4387
1 changed files with 14 additions and 1 deletions
|
|
@ -1,13 +1,23 @@
|
||||||
#Copyright (c) 2018 Ultimaker B.V.
|
#Copyright (c) 2018 Ultimaker B.V.
|
||||||
#Cura is released under the terms of the LGPLv3 or higher.
|
#Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from . import UFPWriter
|
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.i18n import i18nCatalog #To translate the file format description.
|
||||||
from UM.Mesh.MeshWriter import MeshWriter #For the binary mode flag.
|
from UM.Mesh.MeshWriter import MeshWriter #For the binary mode flag.
|
||||||
|
|
||||||
i18n_catalog = i18nCatalog("cura")
|
i18n_catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
def getMetaData():
|
def getMetaData():
|
||||||
|
if "UFPWriter.UFPWriter" not in sys.modules:
|
||||||
|
return {}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"mesh_writer": {
|
"mesh_writer": {
|
||||||
"output": [
|
"output": [
|
||||||
|
|
@ -22,4 +32,7 @@ def getMetaData():
|
||||||
}
|
}
|
||||||
|
|
||||||
def register(app):
|
def register(app):
|
||||||
|
if "UFPWriter.UFPWriter" not in sys.modules:
|
||||||
|
return {}
|
||||||
|
|
||||||
return { "mesh_writer": UFPWriter.UFPWriter() }
|
return { "mesh_writer": UFPWriter.UFPWriter() }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue