From 3cc7c1454bb599c9d13863c553a533cd37e3224f Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 3 Sep 2015 11:18:35 +0200 Subject: [PATCH] move back URI rewriting to main electrum script --- electrum | 15 +++++++++------ gui/qt/__init__.py | 3 --- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/electrum b/electrum index ec09c58ef..fc19c0a27 100755 --- a/electrum +++ b/electrum @@ -479,16 +479,19 @@ if __name__ == '__main__': set_verbosity(config_options.get('verbose')) - config = SimpleConfig(config_options) - cmd_name = config.get('cmd') - # check uri - uri = config.get('url') + uri = config_options.get('url') if uri: - # Assume a file is a payment request - if not os.path.exists(uri) and not re.match('^bitcoin:', uri): + if os.path.exists(uri): + # assume this is a payment request + uri = "bitcoin:?r=file://"+ os.path.join(os.getcwd(), uri) + if not re.match('^bitcoin:', uri): print_stderr('unknown command:', uri) sys.exit(1) + config_options['url'] = uri + + config = SimpleConfig(config_options) + cmd_name = config.get('cmd') # initialize plugins. plugins = None diff --git a/gui/qt/__init__.py b/gui/qt/__init__.py index b4d004ee3..d127684d3 100644 --- a/gui/qt/__init__.py +++ b/gui/qt/__init__.py @@ -229,9 +229,6 @@ class ElectrumGui: self.build_tray_menu() if uri: - if os.path.exists(uri): - # assume this is a payment request - uri = "bitcoin:?r=file://"+ os.path.join(os.getcwd(), uri) w.pay_to_URI(uri) return w