1
0

separate get_errors instead of raising an exception

This commit is contained in:
ThomasV
2014-09-06 15:06:31 +02:00
parent b82e84907e
commit 300125422d
2 changed files with 9 additions and 15 deletions

View File

@@ -23,7 +23,6 @@ from qrtextedit import QRTextEdit
import re
from decimal import Decimal
from electrum import bitcoin
from electrum.i18n import _
RE_ADDRESS = '[1-9A-HJ-NP-Za-km-z]{26,}'
RE_ALIAS = '(.*?)\s*\<([1-9A-HJ-NP-Za-km-z]{26,})\>'
@@ -143,21 +142,17 @@ class PayToEdit(QRTextEdit):
self.unlock_amount()
def get_outputs(self, show_err=True):
def get_errors(self):
return self.errors
def get_outputs(self):
if self.payto_address:
try:
amount = self.amount_edit.get_amount()
except:
amount = None
self.outputs = [('address', self.payto_address, amount)]
if self.errors != [] and show_err:
errtext = ""
for x in self.errors:
errtext += _("Line #") + str(x[0]+1) + ": " + x[1] + "\n"
raise ValueError(_("ABORTING! Invalid Lines found:") + "\n\n" + errtext)
return self.outputs[:]