mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
some import clean-up in qt
This commit is contained in:
parent
9d7cf12244
commit
33d14e4238
18 changed files with 65 additions and 42 deletions
|
@ -1,5 +1,5 @@
|
||||||
# To create a new GUI, please add its code to this directory.
|
# To create a new GUI, please add its code to this directory.
|
||||||
# Three objects are passed to the ElectrumGui: config, daemon and plugins
|
# Three objects are passed to the ElectrumGui: config, daemon and plugins
|
||||||
# The Wallet object is instanciated by the GUI
|
# The Wallet object is instantiated by the GUI
|
||||||
|
|
||||||
# Notifications about network events are sent to the GUI by using network.register_callback()
|
# Notifications about network events are sent to the GUI by using network.register_callback()
|
||||||
|
|
|
@ -42,12 +42,8 @@ from electrum.i18n import _, set_language
|
||||||
from electrum.plugin import run_hook
|
from electrum.plugin import run_hook
|
||||||
from electrum.storage import WalletStorage
|
from electrum.storage import WalletStorage
|
||||||
from electrum.base_wizard import GoBack
|
from electrum.base_wizard import GoBack
|
||||||
# from electrum.synchronizer import Synchronizer
|
|
||||||
# from electrum.verifier import SPV
|
|
||||||
# from electrum.util import DebugMem
|
|
||||||
from electrum.util import (UserCancelled, PrintError,
|
from electrum.util import (UserCancelled, PrintError,
|
||||||
WalletFileException, BitcoinException)
|
WalletFileException, BitcoinException)
|
||||||
# from electrum.wallet import Abstract_Wallet
|
|
||||||
|
|
||||||
from .installwizard import InstallWizard
|
from .installwizard import InstallWizard
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,10 @@
|
||||||
from PyQt5.QtGui import *
|
from PyQt5.QtGui import *
|
||||||
from PyQt5.QtCore import *
|
from PyQt5.QtCore import *
|
||||||
from PyQt5.QtWidgets import *
|
from PyQt5.QtWidgets import *
|
||||||
|
|
||||||
from .util import ButtonsTextEdit
|
from .util import ButtonsTextEdit
|
||||||
|
|
||||||
|
|
||||||
class CompletionTextEdit(ButtonsTextEdit):
|
class CompletionTextEdit(ButtonsTextEdit):
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
|
|
||||||
# source: http://stackoverflow.com/questions/2758159/how-to-embed-a-python-interpreter-in-a-pyqt-widget
|
# source: http://stackoverflow.com/questions/2758159/how-to-embed-a-python-interpreter-in-a-pyqt-widget
|
||||||
|
|
||||||
import sys, os, re
|
import sys
|
||||||
import traceback, platform
|
import os
|
||||||
|
import re
|
||||||
|
import traceback
|
||||||
|
import platform
|
||||||
|
|
||||||
from PyQt5 import QtCore
|
from PyQt5 import QtCore
|
||||||
from PyQt5 import QtGui
|
from PyQt5 import QtGui
|
||||||
from PyQt5 import QtWidgets
|
from PyQt5 import QtWidgets
|
||||||
|
|
||||||
from electrum import util
|
from electrum import util
|
||||||
from electrum.i18n import _
|
from electrum.i18n import _
|
||||||
|
|
||||||
|
|
|
@ -24,14 +24,16 @@
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
|
||||||
from electrum.i18n import _
|
|
||||||
from electrum.bitcoin import is_address
|
|
||||||
from electrum.util import block_explorer_URL
|
|
||||||
from electrum.plugin import run_hook
|
|
||||||
from PyQt5.QtGui import *
|
from PyQt5.QtGui import *
|
||||||
from PyQt5.QtCore import *
|
from PyQt5.QtCore import *
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QAbstractItemView, QFileDialog, QMenu, QTreeWidgetItem)
|
QAbstractItemView, QFileDialog, QMenu, QTreeWidgetItem)
|
||||||
|
|
||||||
|
from electrum.i18n import _
|
||||||
|
from electrum.bitcoin import is_address
|
||||||
|
from electrum.util import block_explorer_URL
|
||||||
|
from electrum.plugin import run_hook
|
||||||
|
|
||||||
from .util import MyTreeWidget, import_meta_gui, export_meta_gui
|
from .util import MyTreeWidget, import_meta_gui, export_meta_gui
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
from electrum.i18n import _
|
import threading
|
||||||
|
|
||||||
from PyQt5.QtGui import *
|
from PyQt5.QtGui import *
|
||||||
from PyQt5.QtCore import *
|
from PyQt5.QtCore import *
|
||||||
from PyQt5.QtWidgets import QSlider, QToolTip
|
from PyQt5.QtWidgets import QSlider, QToolTip
|
||||||
|
|
||||||
import threading
|
from electrum.i18n import _
|
||||||
|
|
||||||
|
|
||||||
class FeeSlider(QSlider):
|
class FeeSlider(QSlider):
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,11 @@ import datetime
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
from electrum.address_synchronizer import TX_HEIGHT_LOCAL
|
from electrum.address_synchronizer import TX_HEIGHT_LOCAL
|
||||||
from .util import *
|
|
||||||
from electrum.i18n import _
|
from electrum.i18n import _
|
||||||
from electrum.util import block_explorer_URL, profiler, print_error, TxMinedStatus
|
from electrum.util import block_explorer_URL, profiler, print_error, TxMinedStatus
|
||||||
|
|
||||||
|
from .util import *
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from electrum.plot import plot_history, NothingToPlotException
|
from electrum.plot import plot_history, NothingToPlotException
|
||||||
except:
|
except:
|
||||||
|
|
|
@ -22,8 +22,12 @@
|
||||||
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
import sys, time, threading
|
import sys
|
||||||
import os, json, traceback
|
import time
|
||||||
|
import threading
|
||||||
|
import os
|
||||||
|
import traceback
|
||||||
|
import json
|
||||||
import shutil
|
import shutil
|
||||||
import weakref
|
import weakref
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
@ -36,8 +40,6 @@ import queue
|
||||||
from PyQt5.QtGui import *
|
from PyQt5.QtGui import *
|
||||||
from PyQt5.QtCore import *
|
from PyQt5.QtCore import *
|
||||||
import PyQt5.QtCore as QtCore
|
import PyQt5.QtCore as QtCore
|
||||||
|
|
||||||
from .exception_window import Exception_Hook
|
|
||||||
from PyQt5.QtWidgets import *
|
from PyQt5.QtWidgets import *
|
||||||
|
|
||||||
from electrum import (keystore, simple_config, ecc, constants, util, bitcoin, commands,
|
from electrum import (keystore, simple_config, ecc, constants, util, bitcoin, commands,
|
||||||
|
@ -56,6 +58,7 @@ from electrum.transaction import Transaction, TxOutput
|
||||||
from electrum.address_synchronizer import AddTransactionException
|
from electrum.address_synchronizer import AddTransactionException
|
||||||
from electrum.wallet import Multisig_Wallet, CannotBumpFee
|
from electrum.wallet import Multisig_Wallet, CannotBumpFee
|
||||||
|
|
||||||
|
from .exception_window import Exception_Hook
|
||||||
from .amountedit import AmountEdit, BTCAmountEdit, MyLineEdit, FeerateEdit
|
from .amountedit import AmountEdit, BTCAmountEdit, MyLineEdit, FeerateEdit
|
||||||
from .qrcodewidget import QRCodeWidget, QRDialog
|
from .qrcodewidget import QRCodeWidget, QRDialog
|
||||||
from .qrtextedit import ShowQRTextEdit, ScanQRTextEdit
|
from .qrtextedit import ShowQRTextEdit, ScanQRTextEdit
|
||||||
|
@ -2504,7 +2507,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
for addr, pk in pklist.items():
|
for addr, pk in pklist.items():
|
||||||
transaction.writerow(["%34s"%addr,pk])
|
transaction.writerow(["%34s"%addr,pk])
|
||||||
else:
|
else:
|
||||||
import json
|
|
||||||
f.write(json.dumps(pklist, indent = 4))
|
f.write(json.dumps(pklist, indent = 4))
|
||||||
|
|
||||||
def do_import_labels(self):
|
def do_import_labels(self):
|
||||||
|
|
|
@ -23,16 +23,19 @@
|
||||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt
|
|
||||||
from PyQt5.QtGui import *
|
|
||||||
from PyQt5.QtWidgets import *
|
|
||||||
from electrum.i18n import _
|
|
||||||
from .util import *
|
|
||||||
import re
|
import re
|
||||||
import math
|
import math
|
||||||
|
|
||||||
|
from PyQt5.QtCore import Qt
|
||||||
|
from PyQt5.QtGui import *
|
||||||
|
from PyQt5.QtWidgets import *
|
||||||
|
|
||||||
|
from electrum.i18n import _
|
||||||
from electrum.plugin import run_hook
|
from electrum.plugin import run_hook
|
||||||
|
|
||||||
|
from .util import *
|
||||||
|
|
||||||
|
|
||||||
def check_password_strength(password):
|
def check_password_strength(password):
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -23,10 +23,11 @@
|
||||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
from PyQt5.QtGui import *
|
|
||||||
import re
|
import re
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
|
from PyQt5.QtGui import *
|
||||||
|
|
||||||
from electrum import bitcoin
|
from electrum import bitcoin
|
||||||
from electrum.util import bfh
|
from electrum.util import bfh
|
||||||
from electrum.transaction import TxOutput
|
from electrum.transaction import TxOutput
|
||||||
|
@ -40,6 +41,7 @@ RE_ALIAS = '(.*?)\s*\<([0-9A-Za-z]{1,})\>'
|
||||||
frozen_style = "QWidget { background-color:none; border:none;}"
|
frozen_style = "QWidget { background-color:none; border:none;}"
|
||||||
normal_style = "QPlainTextEdit { }"
|
normal_style = "QPlainTextEdit { }"
|
||||||
|
|
||||||
|
|
||||||
class PayToEdit(CompletionTextEdit, ScanQRTextEdit):
|
class PayToEdit(CompletionTextEdit, ScanQRTextEdit):
|
||||||
|
|
||||||
def __init__(self, win):
|
def __init__(self, win):
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import os
|
||||||
|
import qrcode
|
||||||
|
|
||||||
from PyQt5.QtCore import *
|
from PyQt5.QtCore import *
|
||||||
from PyQt5.QtGui import *
|
from PyQt5.QtGui import *
|
||||||
|
@ -5,9 +7,6 @@ import PyQt5.QtGui as QtGui
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QApplication, QVBoxLayout, QTextEdit, QHBoxLayout, QPushButton, QWidget)
|
QApplication, QVBoxLayout, QTextEdit, QHBoxLayout, QPushButton, QWidget)
|
||||||
|
|
||||||
import os
|
|
||||||
import qrcode
|
|
||||||
|
|
||||||
import electrum
|
import electrum
|
||||||
from electrum.i18n import _
|
from electrum.i18n import _
|
||||||
from .util import WindowModalDialog
|
from .util import WindowModalDialog
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
|
|
||||||
from electrum.i18n import _
|
|
||||||
from electrum.plugin import run_hook
|
|
||||||
from PyQt5.QtGui import *
|
from PyQt5.QtGui import *
|
||||||
from PyQt5.QtCore import *
|
from PyQt5.QtCore import *
|
||||||
from PyQt5.QtWidgets import QFileDialog
|
from PyQt5.QtWidgets import QFileDialog
|
||||||
|
|
||||||
|
from electrum.i18n import _
|
||||||
|
from electrum.plugin import run_hook
|
||||||
|
|
||||||
from .util import ButtonsTextEdit, MessageBoxMixin, ColorScheme
|
from .util import ButtonsTextEdit, MessageBoxMixin, ColorScheme
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ else:
|
||||||
|
|
||||||
column_index = 4
|
column_index = 4
|
||||||
|
|
||||||
|
|
||||||
class QR_Window(QWidget):
|
class QR_Window(QWidget):
|
||||||
|
|
||||||
def __init__(self, win):
|
def __init__(self, win):
|
||||||
|
|
|
@ -23,13 +23,15 @@
|
||||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
|
from PyQt5.QtGui import *
|
||||||
|
from PyQt5.QtCore import *
|
||||||
|
from PyQt5.QtWidgets import QTreeWidgetItem, QMenu
|
||||||
|
|
||||||
from electrum.i18n import _
|
from electrum.i18n import _
|
||||||
from electrum.util import format_time, age
|
from electrum.util import format_time, age
|
||||||
from electrum.plugin import run_hook
|
from electrum.plugin import run_hook
|
||||||
from electrum.paymentrequest import PR_UNKNOWN
|
from electrum.paymentrequest import PR_UNKNOWN
|
||||||
from PyQt5.QtGui import *
|
|
||||||
from PyQt5.QtCore import *
|
|
||||||
from PyQt5.QtWidgets import QTreeWidgetItem, QMenu
|
|
||||||
from .util import MyTreeWidget, pr_tooltips, pr_icons
|
from .util import MyTreeWidget, pr_tooltips, pr_icons
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@ from electrum.bitcoin import base_encode
|
||||||
from electrum.i18n import _
|
from electrum.i18n import _
|
||||||
from electrum.plugin import run_hook
|
from electrum.plugin import run_hook
|
||||||
from electrum import simple_config
|
from electrum import simple_config
|
||||||
|
|
||||||
from electrum.util import bfh
|
from electrum.util import bfh
|
||||||
from electrum.transaction import SerializationError
|
from electrum.transaction import SerializationError
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,11 @@
|
||||||
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
from .util import *
|
|
||||||
from electrum.i18n import _
|
from electrum.i18n import _
|
||||||
|
|
||||||
|
from .util import *
|
||||||
|
|
||||||
|
|
||||||
class UTXOList(MyTreeWidget):
|
class UTXOList(MyTreeWidget):
|
||||||
filter_columns = [0, 2] # Address, Label
|
filter_columns = [0, 2] # Address, Label
|
||||||
|
|
|
@ -1,15 +1,18 @@
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
_ = lambda x:x
|
import getpass
|
||||||
#from i18n import _
|
import datetime
|
||||||
|
|
||||||
from electrum import WalletStorage, Wallet
|
from electrum import WalletStorage, Wallet
|
||||||
from electrum.util import format_satoshis, set_verbosity
|
from electrum.util import format_satoshis, set_verbosity
|
||||||
from electrum.bitcoin import is_address, COIN, TYPE_ADDRESS
|
from electrum.bitcoin import is_address, COIN, TYPE_ADDRESS
|
||||||
from electrum.transaction import TxOutput
|
from electrum.transaction import TxOutput
|
||||||
import getpass, datetime
|
|
||||||
|
_ = lambda x:x # i18n
|
||||||
|
|
||||||
# minimal fdisk like gui for console usage
|
# minimal fdisk like gui for console usage
|
||||||
# written by rofl0r, with some bits stolen from the text gui (ncurses)
|
# written by rofl0r, with some bits stolen from the text gui (ncurses)
|
||||||
|
|
||||||
|
|
||||||
class ElectrumGui:
|
class ElectrumGui:
|
||||||
|
|
||||||
def __init__(self, config, daemon, plugins):
|
def __init__(self, config, daemon, plugins):
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
import tty, sys
|
import tty
|
||||||
import curses, datetime, locale
|
import sys
|
||||||
|
import curses
|
||||||
|
import datetime
|
||||||
|
import locale
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
import getpass
|
import getpass
|
||||||
|
|
||||||
|
@ -15,7 +18,6 @@ from electrum.interface import deserialize_server
|
||||||
_ = lambda x:x
|
_ = lambda x:x
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ElectrumGui:
|
class ElectrumGui:
|
||||||
|
|
||||||
def __init__(self, config, daemon, plugins):
|
def __init__(self, config, daemon, plugins):
|
||||||
|
|
Loading…
Add table
Reference in a new issue