From 844ebcb234b7604baa49126385fbba87c46e035a Mon Sep 17 00:00:00 2001 From: Sven Sager Date: Thu, 12 Oct 2023 11:59:55 +0200 Subject: [PATCH] feat: Add open-source license viewer to help menu If the application is built with the Target app*, all license information of the packages used is collected. These can now be viewed in the GUI in the help menu. --- .../locale/revpicommander_de.qm | Bin 56798 -> 57251 bytes .../locale/revpicommander_de.ts | 342 ++++++++++-------- src/revpicommander/oss_licenses.py | 84 +++++ src/revpicommander/revpicommander.py | 5 + src/revpicommander/ui/oss_licenses_ui.py | 79 ++++ translate.pro | 1 + ui_dev/oss_licenses.ui | 148 ++++++++ 7 files changed, 502 insertions(+), 157 deletions(-) create mode 100644 src/revpicommander/oss_licenses.py create mode 100644 src/revpicommander/ui/oss_licenses_ui.py create mode 100644 ui_dev/oss_licenses.ui diff --git a/src/revpicommander/locale/revpicommander_de.qm b/src/revpicommander/locale/revpicommander_de.qm index 50514998b12ccfe9b9040d03ed174164215a00fd..7c103cd1cfc6ae0261614c460228025e54c06d24 100644 GIT binary patch delta 3549 zcmaJ@3tZ0k8vnl6|Ns5JH%+S3sK}PfDYe*Q57eR9e^dZ*!+O=?Xys1+6U}7Pgx8Lc057lcTvE&a@5Hg{FW`aET0K< z{T=tlYyoz=qW%tpU$+!Li)BFO6&d>915P{3#M}mw;waO9S_mAyAoJW#z2z}7Z~YCx zVYbYBUKavRmibK%2Kru*`D>n&ytA^vn?C?!I>`oxw6p*VBV@rlKOsVkEcg)FiWnvv zt7l}{6|!aCH29@iX1&`Uu*|T@`7dR=jiJC7`(?+pEeB?4L6W>g#>f|z$V=@y11%oQ%Q{p6hm`WN0hEe3`S~iQ zXo!QnRvQfXOY%z%8lcEW{*B8npdwoS{nO(>mB0J}xW4sg`7_Ij6a4r>p^YTs!X64k z%0*yhb44@fZop?>D_S0u0dMzKcuZLV%-*8t1lEFSs3KH$4JdX|qlf$-oqMS00JuLF+wRS$kv+1AND#tPAJ| ztWQ;5{E3JvS1T{2`UBC$%KN>lSgjY859T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d-3#>ujrA)Ntm%h$Iq2+12 jK9*@-ljS)vkuFKelagmASzHFSDS7VYYA(4~bj AvahiSearch - + Auto discovered Automatisch erkannt @@ -93,7 +93,7 @@ Nicht gespeicherte Änderunen gehen verloren Der ausgewählte RevPi ist schon in der Verbindungsliste als '{0}'. - + over SSH über SSH @@ -229,62 +229,62 @@ Wurde eine Hardwarekonfiguration in piCtory erzeugt? ConnectionManager - + SIMULATING SIMULATION - + NOT CONNECTED NICHT VERBUNDEN - + SERVER ERROR SERVER FEHLER - + RUNNING LÄUFT - + PLC FILE NOT FOUND SPS PROGRAMM NICHT GEFUNDEN - + NOT RUNNING (NO STATUS) LÄUFT NICHT (KEIN STATUS) - + PROGRAM KILLED PROGRAMM GETÖTET - + PROGRAM TERMED PROGRAMM BEENDET - + NOT RUNNING LÄUFT NICHT - + FINISHED WITH CODE {0} BEENDET MIT CODE {0} - + Error Fehler - + The combination of username and password was rejected from the SSH server. Try again. @@ -293,7 +293,7 @@ Try again. Bitte erneut versuchen. - + Could not establish a SSH connection to server: {0} @@ -352,7 +352,7 @@ Das kann eine der folgenden Ursachen haben: Benutze "Über SSH verbinden" um eine verschlüsselte Verbindung aufzubauen oder führe 'sudo revpipyload_secure_installation' auf dem Revolution Pi aus, um eine direkte Verbindung zu konfigurieren! - + Can not connect to RevPiPyLoad XML-RPC service! This could have the following reasons: @@ -373,7 +373,7 @@ Das kann eine der folgenden Ursachen haben: Benutze "Über SSH verbinden" um eine verschlüsselte Verbindung aufzubauen oder führe 'sudo revpipyload_secure_installation' auf dem Revolution Pi aus, um eine direkte Verbindung zu konfigurieren! - + Can not connect to RevPiPyLoad service through SSH tunnel! This could have the following reasons: @@ -391,34 +391,34 @@ Das kann eine der folgenden Ursachen haben: DebugControl - + Driver reset for piControl detected. Treiberneustart in piCtory erkannt. - + Error while getting values from Revolution Pi. Fehler bei Werteempfang von RevPi. - + Auto update values... Werte automatisch aktualisiert... - + Values updated... Werte aktualisiert... - + Error set value of device '{0}' Output '{1}': {2} Fehler beim Setzen des Ausgangs '{1}' auf Modul '{0}': {2} - + Error Fehler @@ -426,37 +426,37 @@ Das kann eine der folgenden Ursachen haben: DebugIos - + signed - + big_endian - + as text - + as number - + Can not use format text Formatierung nicht möglich - + Can not convert bytes {0} to a text for IO '{1}'. Switch to number format instead! Kann bytes {0} für '{1}' nicht in Text konvertieren. Wechseln Sie auf Nummernformat! - + switch wordorder Wordorder tauschen @@ -464,22 +464,22 @@ Das kann eine der folgenden Ursachen haben: MqttManager - + Question Frage - + Error Fehler - + Can not load the MQTT settings dialog. Missing values! Kann MQTT Einstellungen nicht laden. Es fehlen Werte! - + Do you really want to quit? Unsaved changes will be lost. Soll das Fenster wirklich geschlossen werden? @@ -489,86 +489,86 @@ Ungesicherte Änderungen gehen verloren. RevPiCommander - + Simulator started... Simulator gestartet... - + Can not start... Kann nicht gestartet werden... - + Warning Warnung - + This version of Logviewer ist not supported in version {0} of RevPiPyLoad on your RevPi! You need at least version 0.4.1. Diese Version vom Logbetrachter wird in RevPiPyLoad Version {0} nicht unterstützt! Es wird mindestens Version 0.4.1 benötigt. - + XML-RPC access mode in the RevPiPyLoad configuration is too small to access this dialog! XML-RPC Zugriffsberechtigung in der RevPiPyLoad Konfiguraiton ist zu klein für diese Einstellungen! - + Error Fehler - + The Version of RevPiPyLoad on your Revolution Pi ({0}) is to old. This Version of RevPiCommander require at least version 0.6.0 of RevPiPyLoad. Please update your Revolution Pi! Die Version von RevPiPyLoad ({0}) auf dem Revolution Pi ist zu alt. Diese Version vom RevPiCommander braucht mindestens Version 0.6.0. Bitte aktualisiere deinen Revolution Pi! - + Question Frage - + Are you sure to reset piControl? The pictory configuration will be reloaded. During that time the process image will be interrupted and could rise errors on running control programs! Soll piControl wirklich zurückgesetzt werden? Die piCtory Konfiguration wird neu geladen. Das Prozessabbild wird in dieser Zeit nicht verfügbar sein und es könnten Fehler in Steuerungsprogrammen ausgelöst werden! - + Success Erfolgreich - + piControl reset executed successfully piControl wurde erfolgreich zurückgesetzt - + piControl reset could not be executed successfully piControl konnte nicht zurückgesetzt werden - + Reset to piCtory defaults... Standardwerte von piCtory laden... - + The watch mode ist not supported in version {0} of RevPiPyLoad on your RevPi! You need at least version 0.5.3! Maybe the python3-revpimodio2 module is not installed on your RevPi at least version 2.0.0. Der SPS Betrachter ist in Version {0} von RevPiPyLoad auf dem Rev Pi nicht unterstützt! Es muss mindestens Version 0.5.3 installiert sein! Vielleicht fehlt auch das python3-revpimodio2 Modul, welches mindestens Version 2.0.0 haben muss. - + Can not load this function, because your ACL level is to low! You need at least level 1 to read or level 3 to write. Für diese Funktion ist das Berechtigungslevel zu gering! Es muss mindestens Level 1 zum Lesen oder Level 3 zu Schreiben sein. - + Can not load piCtory configuration. Did you create a hardware configuration? Please check this in piCtory! Kann piCtory Konfiguration nicht laden. @@ -588,7 +588,7 @@ Das kann eine der folgenden Ursachen haben: Der Rev Pi ist nicht online, der XML Führe 'sudo revpipyload_secure_installation' auf dem Revolution Pi aus um diese Funktion zu konfigurieren! - + The simulator is running! You can work with this simulator if your call RevPiModIO with this additional parameters: @@ -605,39 +605,39 @@ configrsc={1} Dies kann aus der Textbox oben kopiert werden. - + Can not start the simulator! Maybe the piCtory file is corrupt or you have no write permissions for '{0}'. Kann Simulator nicht starten! Vielleicht ist die piCtory Datei defekt oder es gibt keine Schreibberechtigung für '{0}'. - + Do you want to reset your process image to {0} values? You have to stop other RevPiModIO programs before doing that, because they could reset the outputs. Soll das virtuelle Prozessabbild auf {0} zurückgesetzt werden? Es sollten alle RevPiModIO Programme vorher beendet werden, da diese ihre IO Werte sofort wieder schreiben würden. - + zero null - + piCtory default piCtory Standardwerte - + Revolution Pi connected! Revolution Pi verbunden! - + Connecting... Verbinde... - + Establish a connection to the Revolution Pi... Baue eine Verbindung zum Revolution Pi auf... @@ -651,12 +651,12 @@ We are trying to activate this service now and reconnect. The settings can be ch Wir werden versuchen den Dienst zu starten und eine neue Verbindung herzustellen. Diese Einstellung kann im Webstatus geändert werden. - + Information Information - + Can not connect to RevPiPyLoad service through SSH tunnel! We are trying to activate this service now and reconnect. The settings can be changed at any time via 'webstatus'. @@ -668,92 +668,92 @@ Wir versuchen diesen Dienst jetzt zu aktivieren und verbinden uns neu. Die Einst RevPiFiles - + Please select... Bitte auswählen... - + Error Fehler - + Can not stop plc program on Revolution Pi. Kann SPS Programm auf Rev Pi nicht stoppen. - + The Revolution Pi could not process some parts of the transmission. Der Revolution Pi hat Teile der Übertragung nicht durchgeführt. - + Errors occurred during transmission Fehler bei Übertragung aufgetreten - + Warning Warnung - + Could not start the plc program on Revolution Pi. Kann das SPS Programm auf dem Revolution Pi nicht starten. - + The RevPiPyLoad version on the Revolution Pi is to old. Die RevPiPyLoad Version auf dem Revolution Pi ist zu alt. - + Can not open last directory '{0}'. Kann letztes Verzeichnis '{0}' nicht öffnen. - + Stop scanning for files, because we found more than {0} files. Dateisuche wurde angehalten, da mehr als {0} Dateien gefunden wurden. - + Could not load path of working dir Kann Arbeitsverzeichnis nicht laden - + Can not load file list from Revolution Pi. Kann Dateiliste vom Revolution Pi nicht laden. - + Select folder... Ordner auswählen... - + Can not access the folder '{0}' to read files. Keine Berechtigung für Zugriff auf Ordner '{0}'. - + Error... Fehler... - + Error while download file '{0}'. Fehler beim Herunterladen der Datei '{0}'. - + Override files... Dateien überschreiben... - + One or more files does exist on your computer! Do you want to override the existingfiles? Select 'Yes' to override, 'No' to download only missing files. @@ -762,37 +762,37 @@ Select 'Yes' to override, 'No' to download only missing file Wählen Sie 'Ja' zum Überschreiben, 'Nein' um nur fehlende Dateien zu laden. - + Delete files from Revolution Pi... Dateien auf Rev Pi löschen... - + Do you want to delete {0} files from revolution pi? Sollen {0} Dateien vom Revolution Pi gelöscht werden? - + Error while delete file '{0}'. Fehler beim Löschen der Datei '{0}'. - + Information Information - + A PLC program has been uploaded. Please check the PLC program settings to see if the correct program is specified as the start program. Ein SPS Programm wurde hochgeladen. Bitte prüfe die SPS Programmeinstellungen ob das richtige Startprogramm gewählt ist. - + Choose a local directory first. Lokales Verzeichnis wählen. - + File transfer... Dateiübertragung... @@ -813,7 +813,7 @@ Wählen Sie 'Ja' zum Überschreiben, 'Nein' um nur fehlende RevPiLogfile - + Can not access log file on the RevPi Kann auf Logbuch vom RevPi nicht zugreifen @@ -821,12 +821,12 @@ Wählen Sie 'Ja' zum Überschreiben, 'Nein' um nur fehlende RevPiOption - + Question Frage - + The settings will be set on the Revolution Pi now. ACL changes and service settings are applied immediately. @@ -835,76 +835,76 @@ ACL changes and service settings are applied immediately. Berechtigungseinstellungen werden sofort gesetzt. - + Error Fehler - + The settings could not be saved on the Revolution Pi! Try to save the values one mor time and check the log files of RevPiPyLoad if the error rises again. Die Einstellungen konnten nicht auf dem Revolution Pi gespeichert werden! Versuche es erneut und prüfe die Logdateien von RevPiPyLoad, wenn der Fehler erneut auftritt. - + Do you really want to quit? Unsaved changes will be lost. Soll das Fenster wirklich geschlossen werden? Ungesicherte Änderungen gehen verloren. - + running läuft - + stopped angehalten - + The MQTT service is not available on your RevPiPyLoad version. MQTT ist in der RevPiPyLoad Version nicht verfügbar. - + read only Nur lesen - + read and write lesen und schreiben - + Are you sure you want to deactivate the XML-RPC server? You will NOT be able to access the Revolution Pi with this program after saving the options! Willst du den XML-RPC Server wirklich deaktivieren? Du wirst dich NICHT mehr mit diesem Programm zum Revolution Pi verbinden können! - + Start/Stop PLC program and read logs SPS Programm starten/stoppen und Logs lesen - + + read IOs in watch mode + EAs in SPS Betrachter lesen - + + read properties and download PLC program + Einstellungen lesen und SPS Programm herunterladen - + + upload PLC program + SPS Programm hochladen - + + set properties + Einstellungen ändern @@ -917,19 +917,19 @@ Ungesicherte Änderungen gehen verloren. Neue Verbindung - + Question Frage - + Do you really want to quit? Unsaved changes will be lost. Soll das Fenster wirklich geschlossen werden? Ungesicherte Änderungen gehen verloren. - + If you remote this folder, all containing elements will be removed, too. Do you want to delete folder and all elements? @@ -938,7 +938,7 @@ Do you want to delete folder and all elements? Wollen sie den Ordner und alle Elemente löschen? - + New folder Neuer Ordner @@ -946,22 +946,22 @@ Wollen sie den Ordner und alle Elemente löschen? RevPiProgram - + Error Fehler - + You have to select a start program, before uploading the settings. Es muss erst ein Startprogramm gewählt werden. - + Question Frage - + The settings will be set on the Revolution Pi now. If you made changes on the 'PCL Program' section, your plc program will restart now! @@ -970,245 +970,245 @@ If you made changes on the 'PCL Program' section, your plc program wil Sollte es Änderungen in dem SPS Programmabschnitt geben, wird das SPS Programm neu gestartet! - + The settings could not be saved on the Revolution Pi! Try to save the values one mor time and check the log files of RevPiPyLoad if the error rises again. Die Einstellungen konnten nicht auf dem Revolution Pi gespeichert werden! Versuche es erneut und prüfe die Logdateien von RevPiPyLoad, wenn der Fehler erneut auftritt. - + Do you really want to quit? Unsaved changes will be lost. Soll das Fenster wirklich geschlossen werden? Ungesicherte Änderungen gehen verloren. - + Reset driver... Treiber zurücksetzen... - + Reset piControl driver after successful uploading new piCtory configuration? The process image will be interrupted for a short time! Soll piControl nach dem erfolgreichen Hochladen der neuen piCtory Konfiguration zurückgesetzt werden? Das Prozessabbild wird kurzzeitig nicht verfügbar sein! - + Got an network error while send data to Revolution Pi. Please try again. Beim Senden der Daten an den Revolution Pi trat ein Netzwerkfehler auf. Versuche es erneut. - + Success Erfolgreich - + The transfer of the piCtory configuration and the reset of piControl have been successfully executed. Die piCtory Übertragung und der Reset von piControl wurden erfolgreich durchgeführt. - + The piCtory configuration was successfully transferred. Die piCtory Konfiguration wurde erfolgreich übertragen. - + Can not process the transferred file. Kann die Übertragene Datei nicht verarbeiten. - + Can not find main elements in piCtory file. Konnte piCtory Struktur nicht erkennen. - + Contained devices could not be found on Revolution Pi. The configuration may be from a newer piCtory version! Enthaltene Module können auf dem Revolution Pi nicht gefunden werden. Die Konfiguraiton könnte von einer neueren piCtory Version stammen! - + Could not load RAP catalog on Revolution Pi. Kann RAP Katalog auf dem Revolution Pi nicht laden. - + The piCtory configuration could not be written on the Revolution Pi. Die piCtory Konfiguration konnte nicht auf dem Revolution Pi geschrieben werden. - + Warning Warnung - + The piCtroy configuration has been saved successfully. An error occurred on piControl reset! Die piCtory Konfiguration wurde erfolgreich hochgeladen. Es trat jedoch ein Fehler beim Zurücksetzen von piControl auf! - + Save ZIP archive... ZIP Archiv speichern... - + ZIP archive (*.zip);;All files (*.*) ZIP Archive (*.zip);;Alle Dateien (*.*) - + Save TGZ archive... TGZ Archiv speichern... - + TGZ archive (*.tgz);;All files (*.*) TAR Archive (*.tgz);;Alle Dateien (*.*) - + Could not load PLC program from Revolution Pi. Kann SPS Programm nicht vom Revolution Pi laden. - + Coud not save the archive or extract the files! Please retry. Konnte das Archiv nicht speichern oder extrahieren! Versuche es erneut. - + Transfer successfully completed. Übertragung erfolgreich abgeschlossen. - + Upload content of ZIP archive... ZIP Archiv hochladen... - + The selected file ist not a ZIP archive. Die ausgewählte Datei ist kein ZIP Archiv. - + Upload content of TAR archive... TAR Archiv hochladen... - + TAR archive (*.tgz);;All files (*.*) TAR Archive (*.tgz);;Alle Dateien (*.*) - + The selected file ist not a TAR archive. Die ausgewählte Datei ist kein TAR Archiv. - + No files to upload... Keine Dateien zum Hochladen... - + Found no files to upload in given location or archive. Konnte keine Dateien in der Quelle zum Hochladen finden. - + There was an error deleting the files on the Revolution Pi. Upload aborted! Please try again. Beim Löschen der Dateien auf dem Revolution Pi ist ein Fehler aufgetreten. Hochladen abgebrochen! Versuche es erneut. - + The PLC program was transferred successfully. Das SPS Programm wurde erfolgreich übertragen. - + Information Information - + Could not find the selected PLC start program in uploaded files. This is not an error, if the file was already on the Revolution Pi. Check PLC start program field Konnte eingestelltes SPS Starprogramm in hochgeladenen Dateien nicht finden. Dies ist kein Fehler, wenn das SPS Startprogramm bereits auf dem Rev Pi ist. Prüfe SPS Programm Einstellungen - + There is no piCtory configuration in this archive. Kann keine piCtory Konfiguration im Archiv finden. - + The Revolution Pi could not process some parts of the transmission. Der Revolution Pi konnte Teile der Übertragung nicht verarbeiten. - + Errors occurred during transmission. Fehler bei Übertragung aufgetreten. - + Save piCtory file... piCtory Datei speichern... - + piCtory file (*.rsc);;All files (*.*) piCtory Datei (*.rsc);;Alle Dateien (*.*) - + Could not load piCtory file from Revolution Pi. Kann piCtory Konfiguration nicht vom Revolution Pi laden. - + piCtory configuration successfully loaded and saved to: {0}. piCtory Konfiguration erfolgreich geladen und gespeichert als: {0}. - + Upload piCtory file... piCtory datei hochladen... - + Save piControl file... piCtory Datei speichern... - + Process image file (*.img);;All files (*.*) Processabbild (*.img);;Alle Dateien (*.*) - + Could not load process image from Revolution Pi. Kann Prozessabbild von Revolution Pi nicht laden. - + Process image successfully loaded and saved to: {0}. Prozessabbild erfolgreich geladen und gespeichert als: @@ -1239,12 +1239,12 @@ Dies ist kein Fehler von RevPi Commander. Simulator - + Select downloaded piCtory file... Heruntergeladene piCtory Datei auswählen... - + piCtory file (*.rsc);;All files (*.*) piCtory Datei (*.rsc);;Alle Dateien (*.*) @@ -1637,6 +1637,34 @@ Sende Werte mit Topic: [basistopic]/set/[ausgangsname] Aktiviere XML-RPC für RevPiCommander + + diag_oss_licenses + + + Open-Source licenses + Open-Source Lizenzen + + + + Software + + + + + License + Lizenz + + + + More licenses... + Weitere Lizenzen... + + + + Show more open-source software licenses + Weitere Open-Source Software Lizenzen anzeigen + + diag_program diff --git a/src/revpicommander/oss_licenses.py b/src/revpicommander/oss_licenses.py new file mode 100644 index 0000000..12d1149 --- /dev/null +++ b/src/revpicommander/oss_licenses.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- +"""Open-Source softwrae licenses.""" +__author__ = "Sven Sager" +__copyright__ = "Copyright (C) 2023 Sven Sager" +__license__ = "GPLv2" + +from json import load +from logging import getLogger +from os.path import exists +from typing import List + +from PyQt5 import QtCore, QtWidgets + +from revpicommander.ui.oss_licenses_ui import Ui_diag_oss_licenses + +log = getLogger(__name__) + + +class OssLicenses(QtWidgets.QDialog, Ui_diag_oss_licenses): + def __init__(self, oss_license_file: str, parent=None): + super().__init__(parent) + self.setupUi(self) + + self._lst_licenses: List[dict] = [] + self._oss_license_file = oss_license_file + + self.action_start.setVisible(exists(oss_license_file)) + + def _load_license_file(self) -> None: + if exists(self._oss_license_file): + try: + with open(self._oss_license_file) as fh: + self._lst_licenses = load(fh) + except Exception as e: + log.error("Could not load oss license file: '{0}'".format(e)) + + for i in range(len(self._lst_licenses)): + dict_license = self._lst_licenses[i] + tb_item_name = QtWidgets.QTableWidgetItem(dict_license.get("Name", "")) + tb_item_name.setData(QtCore.Qt.UserRole, i) + tb_item_license = QtWidgets.QTableWidgetItem(dict_license.get("License", "")) + tb_item_license.setToolTip(tb_item_license.text()) + tb_item_license.setData(QtCore.Qt.UserRole, i) + + self.tb_oss_licenses.insertRow(i) + self.tb_oss_licenses.setItem(i, 0, tb_item_name) + self.tb_oss_licenses.setItem(i, 1, tb_item_license) + + self.tb_oss_licenses.resizeColumnsToContents() + + def exec(self) -> int: + # Prevent loading every time the program is starting + if not self._lst_licenses: + self._load_license_file() + + return super().exec() + + @QtCore.pyqtSlot(QtWidgets.QTableWidgetItem, QtWidgets.QTableWidgetItem) + def on_tb_oss_licenses_currentItemChanged( + self, + current: QtWidgets.QTableWidgetItem, + previous: QtWidgets.QTableWidgetItem, + ): + log.debug("Enter slot on_tb_oss_licenses_currentItemChanged") + license_index = current.data(QtCore.Qt.UserRole) + license_object = self._lst_licenses[license_index] + license_object["LicenseText"] = license_object["LicenseText"].replace("\n", "") + self.txt_license.setHtml( + """{Name} +{Description} + + + Version: {Version} + Author: {Author} + URL: {URL} + +
{Description}
+
+ {LicenseText} +
{LicenseText}