willexecutor manager improved
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!env/bin/python3
|
||||
from electrum.storage import WalletStorage
|
||||
from electrum.util import MyEncoder
|
||||
import json
|
||||
from electrum.util import MyEncoder
|
||||
import sys
|
||||
import getpass
|
||||
import os
|
||||
@@ -47,12 +47,12 @@ def save(json_wallet, storage):
|
||||
def read_wallet(path, password=False):
|
||||
storage = WalletStorage(path)
|
||||
if storage.is_encrypted():
|
||||
if password == False:
|
||||
if not password:
|
||||
password = getpass.getpass("Enter wallet password: ", stream=None)
|
||||
storage.decrypt(password)
|
||||
data = storage.read()
|
||||
json_wallet = json.loads("[" + data + "]")[0]
|
||||
return json_wallet
|
||||
return json_wallet, storage
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
@@ -65,7 +65,7 @@ if __name__ == "__main__":
|
||||
exit(1)
|
||||
command = sys.argv[1]
|
||||
path = sys.argv[2]
|
||||
json_wallet = read_wallet(path)
|
||||
json_wallet, storage = read_wallet(path)
|
||||
have_to_save = False
|
||||
if command == "fix":
|
||||
have_to_save = fix_will_settings_tx_fees(json_wallet)
|
||||
|
||||
@@ -15,10 +15,8 @@ from PyQt6.QtWidgets import (
|
||||
QGroupBox,
|
||||
QTextEdit,
|
||||
)
|
||||
from PyQt6.QtCore import Qt
|
||||
from electrum.storage import WalletStorage
|
||||
from electrum.util import MyEncoder
|
||||
from bal_wallet_utils import fix_will_settings_tx_fees, uninstall_bal, read_wallet, save
|
||||
from bal_wallet_utils import fix_will_settings_tx_fees, uninstall_bal, save
|
||||
|
||||
|
||||
class WalletUtilityGUI(QMainWindow):
|
||||
@@ -190,14 +188,6 @@ class WalletUtilityGUI(QMainWindow):
|
||||
def main():
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
# Check if dependencies are available
|
||||
try:
|
||||
from electrum.storage import WalletStorage
|
||||
from electrum.util import MyEncoder
|
||||
except ImportError as e:
|
||||
print(f"ERROR: Cannot import Electrum dependencies: {str(e)}")
|
||||
return 1
|
||||
|
||||
window = WalletUtilityGUI()
|
||||
window.show()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user