Don't open links while having a 0.0 balance
This commit is contained in:
parent
b48800049b
commit
808fbed4f3
1 changed files with 32 additions and 30 deletions
|
@ -16,12 +16,8 @@ def main(args):
|
|||
daemon = xmlrpclib.ServerProxy('http://localhost:7080/')
|
||||
|
||||
try:
|
||||
b = daemon.get_balance()
|
||||
balance = daemon.get_balance()
|
||||
is_running = True
|
||||
except:
|
||||
webbrowser.open('http://lbry.io/get')
|
||||
is_running = False
|
||||
|
||||
if len(args) > 1:
|
||||
print 'Too many args', args
|
||||
|
||||
|
@ -33,8 +29,8 @@ def main(args):
|
|||
r = daemon.get_settings()
|
||||
html = "<body>" + json.dumps(r) + "</body>"
|
||||
r = daemon.render_html(html)
|
||||
|
||||
else:
|
||||
if float(balance) > 0.0:
|
||||
r = daemon.get(args[0][7:])
|
||||
print r
|
||||
path = r['path']
|
||||
|
@ -52,6 +48,12 @@ def main(args):
|
|||
else:
|
||||
webbrowser.open('file://' + str(path))
|
||||
|
||||
except:
|
||||
webbrowser.open('http://lbry.io/get')
|
||||
is_running = False
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1:])
|
Loading…
Reference in a new issue