def __init__(self): self.rpc_ip, self.rpc_port, self.rpc_user, self.rpc_passwd = readRPCfile() rpc_url = "http://%s:%s@%s:%d" % (self.rpc_user, self.rpc_passwd, self.rpc_ip, self.rpc_port) try: self.conn = AuthServiceProxy(rpc_url, timeout=8) except JSONRPCException as e: err_msg = 'remote or local PIVX-cli running?' printException(getCallerName(), getFunctionName(), err_msg, e) except Exception as e: err_msg = 'remote or local PIVX-cli running?' printException(getCallerName(), getFunctionName(), err_msg, e)
def __init__(self, caller): self.caller = caller self.ui = TabAddTorrent_gui(caller) self.caller.tabAddTorrent = self.ui self.ui.submitBtn.clicked.connect(lambda: self.submitTorrent()) rpc_ip, rpc_port, rpc_user, rpc_passwd = readRPCfile() self.server_uri = 'http://{}:{}'.format(rpc_ip, rpc_port) self.auth_pair = rpc_user, rpc_passwd self.current_block = None self.next_super = None self.update = False ThreadFuns.runInThread(self.updater, ())
def __init__(self): # Lock for threads self.lock = threading.Lock() self.rpc_ip, self.rpc_port, self.rpc_user, self.rpc_passwd = readRPCfile( ) rpc_url = "http://%s:%s@%s:%d" % (self.rpc_user, self.rpc_passwd, self.rpc_ip, self.rpc_port) try: self.lock.acquire() self.conn = AuthServiceProxy(rpc_url, timeout=120) except JSONRPCException as e: err_msg = 'remote or local PIVX-cli running?' printException(getCallerName(), getFunctionName(), err_msg, e) except Exception as e: err_msg = 'remote or local PIVX-cli running?' printException(getCallerName(), getFunctionName(), err_msg, e) finally: self.lock.release()
def loadRPCfile(self): self.rpc_ip, self.rpc_port, self.rpc_user, self.rpc_password = readRPCfile( )