__init__.py 1.2 KB

12345678910111213141516171819202122232425
  1. # Copyright (c) 2015 Ultimaker B.V.
  2. # Cura is released under the terms of the AGPLv3 or higher.
  3. from . import USBPrinterOutputDeviceManager
  4. from PyQt5.QtQml import qmlRegisterType, qmlRegisterSingletonType
  5. from UM.i18n import i18nCatalog
  6. i18n_catalog = i18nCatalog("cura")
  7. def getMetaData():
  8. return {
  9. "type": "extension",
  10. "plugin": {
  11. "name": i18n_catalog.i18nc("@label", "USB printing"),
  12. "author": "Ultimaker",
  13. "version": "1.0",
  14. "api": 3,
  15. "description": i18n_catalog.i18nc("@info:whatsthis","Accepts G-Code and sends them to a printer. Plugin can also update firmware.")
  16. }
  17. }
  18. def register(app):
  19. # We are violating the QT API here (as we use a factory, which is technically not allowed).
  20. # but we don't really have another means for doing this (and it seems to you know -work-)
  21. qmlRegisterSingletonType(USBPrinterOutputDeviceManager.USBPrinterOutputDeviceManager, "Cura", 1, 0, "USBPrinterManager", USBPrinterOutputDeviceManager.USBPrinterOutputDeviceManager.getInstance)
  22. return {"extension":USBPrinterOutputDeviceManager.USBPrinterOutputDeviceManager.getInstance(), "output_device": USBPrinterOutputDeviceManager.USBPrinterOutputDeviceManager.getInstance()}