Skip to content

Commit fe9ec6d

Browse files
committed
reformatting
1 parent a1eaf35 commit fe9ec6d

5 files changed

Lines changed: 18 additions & 25 deletions

File tree

gui/qt/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def addButton(self, icon_name, on_click, tooltip):
498498
def addCopyButton(self, app):
499499
self.app = app
500500
f = lambda: self.app.clipboard().setText(str(self.text()))
501-
self.addButton(":icons/copy.png", f, _("Copy to Clipboard"))
501+
self.addButton(":icons/copy.png", f, _("Copy to clipboard"))
502502

503503
class ButtonsLineEdit(QLineEdit, ButtonsWidget):
504504
def __init__(self, text=None):

gui/text.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -359,16 +359,15 @@ def show_message(self, message, getchar = True):
359359
w.refresh()
360360
if getchar: c = self.stdscr.getch()
361361

362-
363362
def run_popup(self, title, items):
364363
return self.run_dialog(title, map(lambda x: {'type':'button','label':x}, items), interval=1, y_pos = self.pos+3)
365364

366-
367365
def network_dialog(self):
368-
if not self.network: return
369-
host, port, protocol, proxy_config, auto_connect = self.network.get_parameters()
366+
if not self.network:
367+
return
368+
params = self.network.get_parameters()
369+
host, port, protocol, proxy_config, auto_connect = params
370370
srv = 'auto-connect' if auto_connect else self.network.default_server
371-
372371
out = self.run_dialog('Network', [
373372
{'label':'server', 'type':'str', 'value':srv},
374373
{'label':'proxy', 'type':'str', 'value':self.config.get('proxy', '')},
@@ -383,16 +382,9 @@ def network_dialog(self):
383382
except Exception:
384383
self.show_message("Error:" + server + "\nIn doubt, type \"auto-connect\"")
385384
return False
386-
387-
if out.get('proxy'):
388-
proxy = self.parse_proxy_options(out.get('proxy'))
389-
else:
390-
proxy = None
391-
385+
proxy = self.parse_proxy_options(out.get('proxy')) if out.get('proxy') else None
392386
self.network.set_parameters(host, port, protocol, proxy, auto_connect)
393387

394-
395-
396388
def settings_dialog(self):
397389
fee = str(Decimal(self.wallet.fee_per_kb(self.config)) / COIN)
398390
out = self.run_dialog('Settings', [

lib/interface.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def get_socket(self):
123123
if s and self.check_host_name(s.getpeercert(), self.host):
124124
self.print_error("SSL certificate signed by CA")
125125
return s
126-
127126
# get server certificate.
128127
# Do not use ssl.get_server_certificate because it does not work with proxy
129128
s = self.get_simple_socket()

lib/wallet.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,25 +155,25 @@ class Abstract_Wallet(PrintError):
155155
max_change_outputs = 3
156156

157157
def __init__(self, storage):
158+
self.electrum_version = ELECTRUM_VERSION
158159
self.storage = storage
159160
self.network = None
160-
self.electrum_version = ELECTRUM_VERSION
161+
# verifier (SPV) and synchronizer are started in start_threads
162+
self.synchronizer = None
163+
self.verifier = None
164+
161165
self.gap_limit_for_change = 6 # constant
162166
# saved fields
163167
self.seed_version = storage.get('seed_version', NEW_SEED_VERSION)
164168
self.use_change = storage.get('use_change',True)
165169
self.multiple_change = storage.get('multiple_change', False)
166-
167170
self.use_encryption = storage.get('use_encryption', False)
168171
self.seed = storage.get('seed', '') # encrypted
169172
self.labels = storage.get('labels', {})
170173
self.frozen_addresses = set(storage.get('frozen_addresses',[]))
171174
self.stored_height = storage.get('stored_height', 0) # last known height (for offline mode)
172175
self.history = storage.get('addr_history',{}) # address -> list(txid, height)
173176

174-
# This attribute is set when wallet.start_threads is called.
175-
self.synchronizer = None
176-
177177
# imported_keys is deprecated. The GUI should call convert_imported_keys
178178
self.imported_keys = self.storage.get('imported_keys',{})
179179

@@ -184,8 +184,6 @@ def __init__(self, storage):
184184
# load requests
185185
self.receive_requests = self.storage.get('payment_requests', {})
186186

187-
# spv
188-
self.verifier = None
189187
# Transactions pending verification. A map from tx hash to transaction
190188
# height. Access is not contended so no lock is needed.
191189
self.unverified_tx = {}
@@ -1564,13 +1562,13 @@ def get_master_public_keys(self):
15641562

15651563
class BIP32_Wallet(Deterministic_Wallet):
15661564
# abstract class, bip32 logic
1567-
root_name = 'x/'
15681565

15691566
def __init__(self, storage):
15701567
Deterministic_Wallet.__init__(self, storage)
15711568
self.master_public_keys = storage.get('master_public_keys', {})
15721569
self.master_private_keys = storage.get('master_private_keys', {})
15731570
self.gap_limit = storage.get('gap_limit', 20)
1571+
self.root_name = 'x/'
15741572

15751573
def is_watching_only(self):
15761574
return not bool(self.master_private_keys)

plugins/ledger/ledger.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,12 @@ def password_dialog(self, msg=None):
319319
if not msg:
320320
msg = _("Do not enter your device PIN here !\r\n\r\n" \
321321
"Your Ledger Wallet wants to talk to you and tell you a unique second factor code.\r\n" \
322-
"For this to work, please open a text editor (on a different computer / device if you believe this computer is compromised) and put your cursor into it, unplug your Ledger Wallet and plug it back in.\r\n" \
323-
"It should show itself to your computer as a keyboard and output the second factor along with a summary of the transaction it is signing into the text-editor.\r\n\r\n" \
322+
"For this to work, please open a text editor " \
323+
"(on a different computer / device if you believe this computer is compromised) " \
324+
"and put your cursor into it, unplug your Ledger Wallet and plug it back in.\r\n" \
325+
"It should show itself to your computer as a keyboard " \
326+
"and output the second factor along with a summary of " \
327+
"the transaction being signed into the text-editor.\r\n\r\n" \
324328
"Check that summary and then enter the second factor code here.\r\n" \
325329
"Before clicking OK, re-plug the device once more (unplug it and plug it again if you read the second factor code on the same computer)")
326330
response = self.handler.prompt_auth(msg)

0 commit comments

Comments
 (0)