move back URI rewriting to main electrum script

This commit is contained in:
ThomasV 2015-09-03 11:18:35 +02:00
parent 87cff8e380
commit 3cc7c1454b
2 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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