topenalias: minor clean-up - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit f819e9b6f4b8670329bf293bbcd9b37c57004a0e
DIR parent af232223ee4c7f5f34e9f21c5bec683b4c417d12
HTML Author: SomberNight <somber.night@protonmail.com>
Date: Mon, 29 Oct 2018 17:09:23 +0100
openalias: minor clean-up
Diffstat:
M electrum/contacts.py | 2 +-
M electrum/gui/qt/paytoedit.py | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
---
DIR diff --git a/electrum/contacts.py b/electrum/contacts.py
t@@ -98,7 +98,7 @@ class Contacts(dict):
try:
records, validated = dnssec.query(url, dns.rdatatype.TXT)
except DNSException as e:
- print_error('Error resolving openalias: ', str(e))
+ print_error(f'Error resolving openalias: {repr(e)}')
return None
prefix = 'btc'
for record in records:
DIR diff --git a/electrum/gui/qt/paytoedit.py b/electrum/gui/qt/paytoedit.py
t@@ -29,7 +29,7 @@ from decimal import Decimal
from PyQt5.QtGui import *
from electrum import bitcoin
-from electrum.util import bfh
+from electrum.util import bfh, PrintError
from electrum.transaction import TxOutput
from .qrtextedit import ScanQRTextEdit
t@@ -42,7 +42,7 @@ frozen_style = "QWidget { background-color:none; border:none;}"
normal_style = "QPlainTextEdit { }"
-class PayToEdit(CompletionTextEdit, ScanQRTextEdit):
+class PayToEdit(CompletionTextEdit, ScanQRTextEdit, PrintError):
def __init__(self, win):
CompletionTextEdit.__init__(self)
t@@ -215,6 +215,7 @@ class PayToEdit(CompletionTextEdit, ScanQRTextEdit):
if self.is_pr:
return
key = str(self.toPlainText())
+ key = key.strip() # strip whitespaces
if key == self.previous_payto:
return
self.previous_payto = key
t@@ -225,7 +226,8 @@ class PayToEdit(CompletionTextEdit, ScanQRTextEdit):
return
try:
data = self.win.contacts.resolve(key)
- except:
+ except Exception as e:
+ self.print_error(f'error resolving address/alias: {repr(e)}')
return
if not data:
return