example:
```
$ ./run_electrum -o version_info
{
"aiohttp.version": "3.8.1",
"aiorpcx.version": "0.22.1",
"certifi.version": "2021.10.08",
"cryptodome.version": null,
"cryptography.path": "/home/user/.local/lib/python3.8/site-packages/cryptography",
"cryptography.version": "3.4.6",
"dnspython.version": "2.2.0",
"electrum.path": "/home/user/wspace/electrum/electrum",
"electrum.version": "4.2.1",
"hidapi.version": "0.11.0.post2",
"libsecp256k1.path": "/home/user/wspace/electrum/electrum/libsecp256k1.so.0",
"libusb.path": "libusb-1.0.so",
"libusb.version": "1.0.23.11397",
"libzbar.path": "/home/user/wspace/electrum/electrum/libzbar.so.0",
"pyaes.version": "1.3.0",
"pyqt.path": "/usr/lib/python3/dist-packages/PyQt5",
"pyqt.version": "5.14.1",
"qt.version": "5.12.8"
}
```
35 lines
1008 B
Python
35 lines
1008 B
Python
# To create a new GUI, please add its code to this directory.
|
|
# Three objects are passed to the ElectrumGui: config, daemon and plugins
|
|
# The Wallet object is instantiated by the GUI
|
|
|
|
# Notifications about network events are sent to the GUI by using network.register_callback()
|
|
|
|
from typing import TYPE_CHECKING, Mapping, Optional
|
|
|
|
if TYPE_CHECKING:
|
|
from . import qt
|
|
from . import kivy
|
|
from electrum.simple_config import SimpleConfig
|
|
from electrum.daemon import Daemon
|
|
from electrum.plugin import Plugins
|
|
|
|
|
|
class BaseElectrumGui:
|
|
def __init__(self, *, config: 'SimpleConfig', daemon: 'Daemon', plugins: 'Plugins'):
|
|
self.config = config
|
|
self.daemon = daemon
|
|
self.plugins = plugins
|
|
|
|
def main(self) -> None:
|
|
raise NotImplementedError()
|
|
|
|
def stop(self) -> None:
|
|
"""Stops the GUI.
|
|
This method must be thread-safe.
|
|
"""
|
|
pass
|
|
|
|
@classmethod
|
|
def version_info(cls) -> Mapping[str, Optional[str]]:
|
|
return {}
|