-
Notifications
You must be signed in to change notification settings - Fork 14
/
engine_generic_object_api.py
33 lines (27 loc) · 1.28 KB
/
engine_generic_object_api.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import json
class EngineGenericObjectApi:
def __init__(self, socket):
self.engine_socket = socket
def get_layout(self, handle):
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "GetLayout", "params": []})
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
try:
return response["result"]
except KeyError:
return response["error"]
def get_hypercube_data(self, handle, path="/qHyperCubeDef", pages=[]):
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "GetHyperCubeData",
"params": [path,pages]})
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
try:
return response["result"]
except KeyError:
return response["error"]
def get_list_object_data(self, handle, path="/qListObjectDef", pages=[]):
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "GetListObjectData",
"params": [path, pages]})
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
try:
return response["result"]
except KeyError:
return response["error"]