move check for if daemon is running to inside of function

This commit is contained in:
Jack 2016-07-06 02:20:18 -04:00
parent 257e38de12
commit 34b1259dc6

View file

@ -4,14 +4,16 @@ import json
from lbrynet.conf import API_CONNECTION_STRING, LOG_FILE_NAME from lbrynet.conf import API_CONNECTION_STRING, LOG_FILE_NAME
from jsonrpc.proxy import JSONRPCProxy from jsonrpc.proxy import JSONRPCProxy
api = JSONRPCProxy.from_url(API_CONNECTION_STRING)
try:
s = api.is_running()
except:
print "lbrynet-daemon isn't running"
def main(): def main():
api = JSONRPCProxy.from_url(API_CONNECTION_STRING)
try:
s = api.is_running()
except:
print "lbrynet-daemon isn't running"
sys.exit(1)
args = sys.argv[1:] args = sys.argv[1:]
meth = args[0] meth = args[0]
if len(args) > 1: if len(args) > 1: