Update daemon and uri handler

Add command to stop daemon from the terminal

If lbrynet-daemon isn’t running the uri handler will now redirect to
lbry.io/get
This commit is contained in:
Jack 2016-01-22 09:44:38 -05:00
parent e144b26619
commit 1e73b2437d
3 changed files with 31 additions and 3 deletions

View file

@ -0,0 +1,21 @@
import xmlrpclib
def main():
daemon = xmlrpclib.ServerProxy("http://localhost:7080/")
try:
b = daemon.get_balance()
is_running = True
except:
is_running = False
if is_running:
try:
daemon.stop()
except:
print "LBRYnet daemon stopped"
else:
print "LBRYnet daemon wasn't running"
if __name__ == '__main__':
main()

View file

@ -15,11 +15,17 @@ def main(args):
daemon = xmlrpclib.ServerProxy('http://localhost:7080/') daemon = xmlrpclib.ServerProxy('http://localhost:7080/')
try:
b = daemon.get_balance()
is_running = True
except:
webbrowser.open('http://lbry.io/get')
is_running = False
if len(args) > 1: if len(args) > 1:
print 'Too many args', args print 'Too many args', args
else: elif is_running:
if args[0][7:] == 'lbry': if args[0][7:] == 'lbry':
daemon.render_gui() daemon.render_gui()

View file

@ -22,6 +22,7 @@ setup(name='lbrynet',
'lbrynet-lookup-hosts-for-hash = lbrynet.dht_scripts:get_hosts_for_hash_in_dht', 'lbrynet-lookup-hosts-for-hash = lbrynet.dht_scripts:get_hosts_for_hash_in_dht',
'lbrynet-announce_hash_to_dht = lbrynet.dht_scripts:announce_hash_to_dht', 'lbrynet-announce_hash_to_dht = lbrynet.dht_scripts:announce_hash_to_dht',
'lbrynet-daemon = lbrynet.lbrynet_daemon.LBRYDaemon:main', 'lbrynet-daemon = lbrynet.lbrynet_daemon.LBRYDaemon:main',
'stop-lbrynet-daemon = lbrynet.lbrynet_daemon.LBRYDaemonStopper:main',
] ]
}, },
data_files=[ data_files=[