mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 01:11:35 +00:00
Check URI in "electrum" because of ambiguity
This commit is contained in:
parent
27917af2bf
commit
87cff8e380
2 changed files with 10 additions and 7 deletions
9
electrum
9
electrum
|
@ -20,6 +20,7 @@
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
@ -481,6 +482,14 @@ if __name__ == '__main__':
|
||||||
config = SimpleConfig(config_options)
|
config = SimpleConfig(config_options)
|
||||||
cmd_name = config.get('cmd')
|
cmd_name = config.get('cmd')
|
||||||
|
|
||||||
|
# check uri
|
||||||
|
uri = config.get('url')
|
||||||
|
if uri:
|
||||||
|
# Assume a file is a payment request
|
||||||
|
if not os.path.exists(uri) and not re.match('^bitcoin:', uri):
|
||||||
|
print_stderr('unknown command:', uri)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# initialize plugins.
|
# initialize plugins.
|
||||||
plugins = None
|
plugins = None
|
||||||
if not is_android:
|
if not is_android:
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import re
|
|
||||||
import signal
|
import signal
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -230,15 +229,10 @@ class ElectrumGui:
|
||||||
self.build_tray_menu()
|
self.build_tray_menu()
|
||||||
|
|
||||||
if uri:
|
if uri:
|
||||||
print "URI: ", uri
|
|
||||||
if os.path.exists(uri):
|
if os.path.exists(uri):
|
||||||
# assume this is a payment request
|
# assume this is a payment request
|
||||||
uri = "bitcoin:?r=file://"+ os.path.join(os.getcwd(), uri)
|
uri = "bitcoin:?r=file://"+ os.path.join(os.getcwd(), uri)
|
||||||
if re.match('^bitcoin:', uri):
|
|
||||||
w.pay_to_URI(uri)
|
w.pay_to_URI(uri)
|
||||||
else:
|
|
||||||
QMessageBox.critical(None, "Error",
|
|
||||||
_("bad bitcoin URI: %s") % uri)
|
|
||||||
|
|
||||||
return w
|
return w
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue