File: __init__.py

package info (click to toggle)
cura 5.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 122,888 kB
  • sloc: python: 44,572; sh: 81; xml: 32; makefile: 16
file content (38 lines) | stat: -rw-r--r-- 1,059 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#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() }