mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-18 20:28:01 -06:00
Gather and display details of licences for pip packages
CURA-12400
This commit is contained in:
parent
7c04124719
commit
0a112c6c53
7 changed files with 218 additions and 62 deletions
45
cura/UI/OpenSourceDependency.py
Normal file
45
cura/UI/OpenSourceDependency.py
Normal file
|
@ -0,0 +1,45 @@
|
|||
# Copyright (c) 2025 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt6.QtCore import QObject, pyqtProperty, pyqtEnum
|
||||
|
||||
|
||||
class OpenSourceDependency(QObject):
|
||||
|
||||
def __init__(self, name, data):
|
||||
super().__init__()
|
||||
self._name = name
|
||||
self._author = data['author'] if data['author'] is not None else ''
|
||||
self._version = data['version'] if data['version'] is not None else ''
|
||||
self._summary = data['summary'] if data['summary'] is not None else ''
|
||||
self._license = data['license'] if data['license'] is not None and len(data['license']) > 0 else name
|
||||
self._license_full = data['license_full'] if 'license_full' in data else ''
|
||||
self._sources_url = data['sources_url'] if 'sources_url' in data else ''
|
||||
|
||||
@pyqtProperty(str, constant=True)
|
||||
def name(self):
|
||||
return self._name
|
||||
|
||||
@pyqtProperty(str, constant=True)
|
||||
def author(self):
|
||||
return self._author
|
||||
|
||||
@pyqtProperty(str, constant=True)
|
||||
def version(self):
|
||||
return self._version
|
||||
|
||||
@pyqtProperty(str, constant=True)
|
||||
def summary(self):
|
||||
return self._summary
|
||||
|
||||
@pyqtProperty(str, constant=True)
|
||||
def license(self):
|
||||
return self._license
|
||||
|
||||
@pyqtProperty(str, constant=True)
|
||||
def license_full(self):
|
||||
return self._license_full
|
||||
|
||||
@pyqtProperty(str, constant=True)
|
||||
def sources_url(self):
|
||||
return self._sources_url
|
Loading…
Add table
Add a link
Reference in a new issue