Merge pull request #11 from jackrobison/master
Update daemon and uri handler
This commit is contained in:
commit
82944bc103
3 changed files with 31 additions and 3 deletions
21
lbrynet/lbrynet_daemon/LBRYDaemonStopper.py
Normal file
21
lbrynet/lbrynet_daemon/LBRYDaemonStopper.py
Normal 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()
|
|
@ -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()
|
||||||
|
|
||||||
|
|
3
setup.py
3
setup.py
|
@ -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=[
|
||||||
|
@ -43,4 +44,4 @@ setup(name='lbrynet',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
Loading…
Reference in a new issue