Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import urllib.parse
4class ClientIf:
6 def __init__(self, addr: str, params: dict = {}):
7 self.addr = addr # URL or host:port
8 self.params = params # Client options
9 try:
10 if addr.find("/") == -1:
11 addr = "//" + addr
12 self.addr_parsed = urllib.parse.urlsplit(addr)
13 except Exception:
14 pass
16 def call(self, method: str, params=None):
17 pass
19 def asynccall(self, loop, method: str, params=None):
20 return loop.run_in_executor(None, self.call, method, params)