Esempio n. 1
0
File: xbmc.py Progetto: 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)
Esempio n. 2
0
File: xbmc.py Progetto: 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"}
Esempio n. 3
0
 def __init__(self):
     self.items_per_page = 11
     ServiceConnection.__init__(self, TWITCH_HOST, https=True)