tMerge pull request #408 from wozz/URI-update - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit 75ab58396292c7f77bb742e78a4ca6b634b586b0 (DIR) parent 9b247c1653640106bd63e0e359e2ccc6d9479fbd (HTM) Author: Maran <maran.hidskes@gmail.com> Date: Wed, 13 Nov 2013 04:43:20 -0800 Merge pull request #408 from wozz/URI-update Mac OSX bitcoin: URI updates Diffstat: M gui/qt/__init__.py | 2 +- M gui/qt/main_window.py | 7 ++++++- M lib/util.py | 1 + M setup-release.py | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) --- (DIR) diff --git a/gui/qt/__init__.py b/gui/qt/__init__.py t@@ -60,7 +60,7 @@ class OpenFileEventFilter(QObject): def eventFilter(self, obj, event): if event.type() == QtCore.QEvent.FileOpen: if len(self.windows) >= 1: - self.windows[0].set_url(event.url().toString()) + self.windows[0].set_url(event.url().toEncoded()) return True return False (DIR) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py t@@ -923,7 +923,12 @@ class ElectrumWindow(QMainWindow): def set_url(self, url): address, amount, label, message, signature, identity, url = util.parse_url(url) - if amount and self.base_unit() == 'mBTC': amount = str( 1000* Decimal(amount)) + try: + if amount and self.base_unit() == 'mBTC': amount = str( 1000* Decimal(amount)) + elif amount: amount = str(Decimal(amount)) + except Exception: + amount = "0.0" + QMessageBox.warning(self, _('Error'), _('Invalid Amount'), _('OK')) if self.mini: self.mini.set_payment_fields(address, amount) (DIR) diff --git a/lib/util.py b/lib/util.py t@@ -155,6 +155,7 @@ _ud = re.compile('%([0-9a-hA-H]{2})', re.MULTILINE) urldecode = lambda x: _ud.sub(lambda m: chr(int(m.group(1), 16)), x) def parse_url(url): + url = str(url) o = url[8:].split('?') address = o[0] if len(o)>1: (DIR) diff --git a/setup-release.py b/setup-release.py t@@ -35,11 +35,11 @@ if sys.platform == 'darwin': extra_options = dict( setup_requires=['py2app'], app=[mainscript], - options=dict(py2app=dict(argv_emulation=True, + options=dict(py2app=dict(argv_emulation=False, includes=['PyQt4.QtCore', 'PyQt4.QtGui', 'sip'], packages=['lib', 'gui', 'plugins'], iconfile='electrum.icns', - #plist=plist, + plist=plist, resources=["data", "icons"])), ) elif sys.platform == 'win32':