Merge pull request #7761 from SomberNight/202204_versioninfo_cmd
add `version_info` command
This commit is contained in:
@@ -30,12 +30,15 @@ import traceback
|
||||
import threading
|
||||
from typing import Optional, TYPE_CHECKING, List
|
||||
|
||||
from electrum import GuiImportError
|
||||
|
||||
try:
|
||||
import PyQt5
|
||||
import PyQt5.QtGui
|
||||
except Exception:
|
||||
sys.exit("Error: Could not import PyQt5 on Linux systems, you may try 'sudo apt-get install python3-pyqt5'")
|
||||
except Exception as e:
|
||||
raise GuiImportError(
|
||||
"Error: Could not import PyQt5 on Linux systems, "
|
||||
"you may try 'sudo apt-get install python3-pyqt5'") from e
|
||||
|
||||
from PyQt5.QtGui import QGuiApplication
|
||||
from PyQt5.QtWidgets import (QApplication, QSystemTrayIcon, QWidget, QMenu,
|
||||
@@ -469,3 +472,13 @@ class ElectrumGui(BaseElectrumGui, Logger):
|
||||
def stop(self):
|
||||
self.logger.info('closing GUI')
|
||||
self.app.quit_signal.emit()
|
||||
|
||||
@classmethod
|
||||
def version_info(cls):
|
||||
ret = {
|
||||
"qt.version": QtCore.QT_VERSION_STR,
|
||||
"pyqt.version": QtCore.PYQT_VERSION_STR,
|
||||
}
|
||||
if hasattr(PyQt5, "__path__"):
|
||||
ret["pyqt.path"] = ", ".join(PyQt5.__path__ or [])
|
||||
return ret
|
||||
|
||||
Reference in New Issue
Block a user