Browse Source

some import clean-up in qt

3.3.3.1
SomberNight 6 years ago
parent
commit
33d14e4238
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 2
      electrum/gui/__init__.py
  2. 4
      electrum/gui/qt/__init__.py
  3. 2
      electrum/gui/qt/completion_text_edit.py
  4. 9
      electrum/gui/qt/console.py
  5. 10
      electrum/gui/qt/contact_list.py
  6. 6
      electrum/gui/qt/fee_slider.py
  7. 3
      electrum/gui/qt/history_list.py
  8. 12
      electrum/gui/qt/main_window.py
  9. 9
      electrum/gui/qt/password_dialog.py
  10. 4
      electrum/gui/qt/paytoedit.py
  11. 5
      electrum/gui/qt/qrcodewidget.py
  12. 6
      electrum/gui/qt/qrtextedit.py
  13. 1
      electrum/gui/qt/qrwindow.py
  14. 8
      electrum/gui/qt/request_list.py
  15. 1
      electrum/gui/qt/transaction_dialog.py
  16. 4
      electrum/gui/qt/utxo_list.py
  17. 9
      electrum/gui/stdio.py
  18. 8
      electrum/gui/text.py

2
electrum/gui/__init__.py

@ -1,5 +1,5 @@
# 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 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()

4
electrum/gui/qt/__init__.py

@ -42,12 +42,8 @@ from electrum.i18n import _, set_language
from electrum.plugin import run_hook
from electrum.storage import WalletStorage
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,
WalletFileException, BitcoinException)
# from electrum.wallet import Abstract_Wallet
from .installwizard import InstallWizard

2
electrum/gui/qt/completion_text_edit.py

@ -26,8 +26,10 @@
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from .util import ButtonsTextEdit
class CompletionTextEdit(ButtonsTextEdit):
def __init__(self, parent=None):

9
electrum/gui/qt/console.py

@ -1,11 +1,16 @@
# source: http://stackoverflow.com/questions/2758159/how-to-embed-a-python-interpreter-in-a-pyqt-widget
import sys, os, re
import traceback, platform
import sys
import os
import re
import traceback
import platform
from PyQt5 import QtCore
from PyQt5 import QtGui
from PyQt5 import QtWidgets
from electrum import util
from electrum.i18n import _

10
electrum/gui/qt/contact_list.py

@ -24,14 +24,16 @@
# SOFTWARE.
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.QtCore import *
from PyQt5.QtWidgets import (
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

6
electrum/gui/qt/fee_slider.py

@ -1,9 +1,11 @@
from electrum.i18n import _
import threading
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import QSlider, QToolTip
import threading
from electrum.i18n import _
class FeeSlider(QSlider):

3
electrum/gui/qt/history_list.py

@ -28,10 +28,11 @@ import datetime
from datetime import date
from electrum.address_synchronizer import TX_HEIGHT_LOCAL
from .util import *
from electrum.i18n import _
from electrum.util import block_explorer_URL, profiler, print_error, TxMinedStatus
from .util import *
try:
from electrum.plot import plot_history, NothingToPlotException
except:

12
electrum/gui/qt/main_window.py

@ -22,8 +22,12 @@
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import sys, time, threading
import os, json, traceback
import sys
import time
import threading
import os
import traceback
import json
import shutil
import weakref
import webbrowser
@ -36,8 +40,6 @@ import queue
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import PyQt5.QtCore as QtCore
from .exception_window import Exception_Hook
from PyQt5.QtWidgets import *
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.wallet import Multisig_Wallet, CannotBumpFee
from .exception_window import Exception_Hook
from .amountedit import AmountEdit, BTCAmountEdit, MyLineEdit, FeerateEdit
from .qrcodewidget import QRCodeWidget, QRDialog
from .qrtextedit import ShowQRTextEdit, ScanQRTextEdit
@ -2504,7 +2507,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
for addr, pk in pklist.items():
transaction.writerow(["%34s"%addr,pk])
else:
import json
f.write(json.dumps(pklist, indent = 4))
def do_import_labels(self):

9
electrum/gui/qt/password_dialog.py

@ -23,15 +23,18 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import re
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 .util import *
import re
import math
from electrum.plugin import run_hook
def check_password_strength(password):

4
electrum/gui/qt/paytoedit.py

@ -23,10 +23,11 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from PyQt5.QtGui import *
import re
from decimal import Decimal
from PyQt5.QtGui import *
from electrum import bitcoin
from electrum.util import bfh
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;}"
normal_style = "QPlainTextEdit { }"
class PayToEdit(CompletionTextEdit, ScanQRTextEdit):
def __init__(self, win):

5
electrum/gui/qt/qrcodewidget.py

@ -1,3 +1,5 @@
import os
import qrcode
from PyQt5.QtCore import *
from PyQt5.QtGui import *
@ -5,9 +7,6 @@ import PyQt5.QtGui as QtGui
from PyQt5.QtWidgets import (
QApplication, QVBoxLayout, QTextEdit, QHBoxLayout, QPushButton, QWidget)
import os
import qrcode
import electrum
from electrum.i18n import _
from .util import WindowModalDialog

6
electrum/gui/qt/qrtextedit.py

@ -1,10 +1,10 @@
from electrum.i18n import _
from electrum.plugin import run_hook
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import QFileDialog
from electrum.i18n import _
from electrum.plugin import run_hook
from .util import ButtonsTextEdit, MessageBoxMixin, ColorScheme

1
electrum/gui/qt/qrwindow.py

@ -41,6 +41,7 @@ else:
column_index = 4
class QR_Window(QWidget):
def __init__(self, win):

8
electrum/gui/qt/request_list.py

@ -23,13 +23,15 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import QTreeWidgetItem, QMenu
from electrum.i18n import _
from electrum.util import format_time, age
from electrum.plugin import run_hook
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

1
electrum/gui/qt/transaction_dialog.py

@ -38,7 +38,6 @@ from electrum.bitcoin import base_encode
from electrum.i18n import _
from electrum.plugin import run_hook
from electrum import simple_config
from electrum.util import bfh
from electrum.transaction import SerializationError

4
electrum/gui/qt/utxo_list.py

@ -22,9 +22,11 @@
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from .util import *
from electrum.i18n import _
from .util import *
class UTXOList(MyTreeWidget):
filter_columns = [0, 2] # Address, Label

9
electrum/gui/stdio.py

@ -1,15 +1,18 @@
from decimal import Decimal
_ = lambda x:x
#from i18n import _
import getpass
import datetime
from electrum import WalletStorage, Wallet
from electrum.util import format_satoshis, set_verbosity
from electrum.bitcoin import is_address, COIN, TYPE_ADDRESS
from electrum.transaction import TxOutput
import getpass, datetime
_ = lambda x:x # i18n
# minimal fdisk like gui for console usage
# written by rofl0r, with some bits stolen from the text gui (ncurses)
class ElectrumGui:
def __init__(self, config, daemon, plugins):

8
electrum/gui/text.py

@ -1,5 +1,8 @@
import tty, sys
import curses, datetime, locale
import tty
import sys
import curses
import datetime
import locale
from decimal import Decimal
import getpass
@ -15,7 +18,6 @@ from electrum.interface import deserialize_server
_ = lambda x:x
class ElectrumGui:
def __init__(self, config, daemon, plugins):

Loading…
Cancel
Save