예제 #1
0
파일: xbmc.py 프로젝트: avida/webguy
class JsonRPC:

    def __init__(self):
        self.connection = ServiceConnection("127.0.0.1:8082")
        self.template = '{"jsonrpc":"2.0","id":"1","method":"%s","params":%s}'
        self.url_template = "/jsonrpc"
        self.hdrs = {"Content-Type": "application/json"}

    def method(self, method, params):
        body = self.template % (method, json.dumps(params))
        resp = self.connection.getData(
            self.url_template, headers=self.hdrs, data=body)
        return json.loads(resp)
예제 #2
0
파일: xbmc.py 프로젝트: avida/webguy
 def __init__(self):
     self.connection = ServiceConnection("127.0.0.1:8082")
     self.template = '{"jsonrpc":"2.0","id":"1","method":"%s","params":%s}'
     self.url_template = "/jsonrpc"
     self.hdrs = {"Content-Type": "application/json"}
예제 #3
0
파일: twitch.py 프로젝트: avida/webguy
 def __init__(self):
     self.items_per_page = 11
     ServiceConnection.__init__(self, TWITCH_HOST, https=True)