OpenSourceDependency.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright (c) 2025 UltiMaker
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from PyQt6.QtCore import QObject, pyqtProperty, pyqtEnum
  4. class OpenSourceDependency(QObject):
  5. def __init__(self, name, data):
  6. super().__init__()
  7. self._name = name
  8. self._version = data['version'] if data['version'] is not None else ''
  9. self._summary = data['summary'] if data['summary'] is not None else ''
  10. self._license = data['license'] if data['license'] is not None and len(data['license']) > 0 else name
  11. self._license_full = data['license_full'] if 'license_full' in data else ''
  12. self._sources_url = data['sources_url'] if 'sources_url' in data else ''
  13. @pyqtProperty(str, constant=True)
  14. def name(self):
  15. return self._name
  16. @pyqtProperty(str, constant=True)
  17. def version(self):
  18. return self._version
  19. @pyqtProperty(str, constant=True)
  20. def summary(self):
  21. return self._summary
  22. @pyqtProperty(str, constant=True)
  23. def license(self):
  24. return self._license
  25. @pyqtProperty(str, constant=True)
  26. def license_full(self):
  27. return self._license_full
  28. @pyqtProperty(str, constant=True)
  29. def sources_url(self):
  30. return self._sources_url