comparison frontends/sat_bridge_frontend/DBus.py @ 65:d35c5edab53f

SàT: multi-profile: memory & dbus bridge's methods profile management /!\ profiles not managed yet for dbus signals
author Goffi <goffi@goffi.org>
date Sun, 31 Jan 2010 15:57:03 +1100
parents d46f849664aa
children 8147b4f40809
comparison
equal deleted inserted replaced
64:d46f849664aa 65:d35c5edab53f
38 if iface == "communication": 38 if iface == "communication":
39 self.db_comm_iface.connect_to_signal(functionName, handler) 39 self.db_comm_iface.connect_to_signal(functionName, handler)
40 elif iface == "request": 40 elif iface == "request":
41 self.db_req_iface.connect_to_signal(functionName, handler) 41 self.db_req_iface.connect_to_signal(functionName, handler)
42 42
43 def connect(self): 43 def connect(self, profile_key='@DEFAULT@'):
44 return self.db_comm_iface.connect() 44 return self.db_comm_iface.connect(profile_key)
45 45
46 def disconnect(self): 46 def disconnect(self, profile_key='@DEFAULT@'):
47 return self.db_comm_iface.disconnect() 47 return self.db_comm_iface.disconnect(profile_key)
48
49 def isConnected(self, profile_key='@DEFAULT@'):
50 return self.db_comm_iface.isConnected(profile_key)
48 51
49 def getContacts(self): 52 def getContacts(self, profile_key='@DEFAULT@'):
50 return self.db_comm_iface.getContacts() 53 return self.db_comm_iface.getContacts(profile_key)
51 54
52 def getPresenceStatus(self): 55 def getPresenceStatus(self, profile_key='@DEFAULT@'):
53 return self.db_comm_iface.getPresenceStatus() 56 return self.db_comm_iface.getPresenceStatus(profile_key)
54 57
55 def getWaitingSub(self): 58 def getWaitingSub(self, profile_key='@DEFAULT@'):
56 return self.db_comm_iface.getWaitingSub() 59 return self.db_comm_iface.getWaitingSub(profile_key)
57 60
58 def sendMessage(self, to, message): 61 def sendMessage(self, to, message, profile_key='@DEFAULT@'):
59 return self.db_comm_iface.sendMessage(to, message) 62 return self.db_comm_iface.sendMessage(to, message, profile_key)
60 63
64 def setPresence(self, to="", show="", priority=0, statuses={}, profile_key='@DEFAULT@'):
65 return self.db_comm_iface.setPresence(to, show, priority, statuses, profile_key)
66
67 def subscription(self, type, entity, profile_key='@DEFAULT@'):
68 return self.db_comm_iface.subscription(type, entity, profile_key)
69
70 def setParam(self, name, value, category, profile_key='@DEFAULT@'):
71 return self.db_comm_iface.setParam(name, value, category, profile_key)
72
73 def getParamA(self, name, category, profile_key='@DEFAULT@'):
74 return self.db_comm_iface.getParamA(name, category, profile_key)
75
76 def getParams(self, profile_key='@DEFAULT@'):
77 return self.db_comm_iface.getParams(profile_key)
78
79 def getParamsForCategory(self, category, profile_key='@DEFAULT@'):
80 return self.db_comm_iface.getParamsForCategory(category, profile_key)
81
82 def getParamsCategories(self):
83 return self.db_comm_iface.getParamsCategories(profile_key)
84
85 def getHistory(self, from_jid, to_jid, size):
86 return self.db_comm_iface.getHistory(from_jid, to_jid, size)
87
88 def addContact(self, jid, profile_key='@DEFAULT@'):
89 return self.db_comm_iface.addContact(jid, profile_key)
90
91 def delContact(self, jid, profile_key='@DEFAULT@'):
92 return self.db_comm_iface.delContact(jid, profile_key)
93
94 def launchAction(self, type, data):
95 return self.db_req_iface.launchAction(type, data)
96
97 def confirmationAnswer(self, id, accepted, data):
98 return self.db_req_iface.confirmationAnswer(id, accepted, data)
99
100 #methods from plugins
61 def sendFile(self, to, path, profile_key='@DEFAULT@'): 101 def sendFile(self, to, path, profile_key='@DEFAULT@'):
62 return self.db_comm_iface.sendFile(to, path, profile_key) 102 return self.db_comm_iface.sendFile(to, path, profile_key)
63 103
64 def findGateways(self, target): 104 def findGateways(self, target, profile_key='@DEFAULT@'):
65 return self.db_comm_iface.findGateways(target) 105 return self.db_comm_iface.findGateways(target, profile_key)
66 106
67 def getCard(self, target, profile_key='@DEFAULT@'): 107 def getCard(self, target, profile_key='@DEFAULT@'):
68 return self.db_comm_iface.getCard(target, profile_key) 108 return self.db_comm_iface.getCard(target, profile_key)
69 109
70 def getCardCache(self, target): 110 def getCardCache(self, target):
73 def getAvatarFile(self, hash): 113 def getAvatarFile(self, hash):
74 return self.db_comm_iface.getAvatarFile(hash) 114 return self.db_comm_iface.getAvatarFile(hash)
75 115
76 def in_band_register(self, target, profile_key='@DEFAULT@'): 116 def in_band_register(self, target, profile_key='@DEFAULT@'):
77 return self.db_comm_iface.in_band_register(target, profile_key) 117 return self.db_comm_iface.in_band_register(target, profile_key)
78
79 def setPresence(self, to="", show="", priority=0, statuses={}):
80 return self.db_comm_iface.setPresence(to, show, priority, statuses)
81
82 def subscription(self, type, entity):
83 return self.db_comm_iface.subscription(type, entity)
84
85 def setParam(self, name, value, category):
86 return self.db_comm_iface.setParam(name, value, category)
87
88 def getParamA(self, name, category):
89 return self.db_comm_iface.getParamA(name, category)
90
91 def getParams(self):
92 return self.db_comm_iface.getParams()
93
94 def getParamsForCategory(self, category):
95 return self.db_comm_iface.getParamsForCategory(category)
96
97 def getParamsCategories(self):
98 return self.db_comm_iface.getParamsCategories()
99
100 def getHistory(self, from_jid, to_jid, size):
101 return self.db_comm_iface.getHistory(from_jid, to_jid, size)
102
103 def addContact(self, jid):
104 return self.db_comm_iface.addContact(jid)
105
106 def delContact(self, jid):
107 return self.db_comm_iface.delContact(jid)
108
109 def isConnected(self):
110 return self.db_comm_iface.isConnected()
111
112 def launchAction(self, type, data):
113 return self.db_req_iface.launchAction(type, data)
114
115 def confirmationAnswer(self, id, accepted, data):
116 return self.db_req_iface.confirmationAnswer(id, accepted, data)
117 118
118 def gatewayRegister(self, action, target, data): 119 def gatewayRegister(self, action, target, data):
119 if data == None: 120 if data == None:
120 data = [('', '')] #XXX: we have to this awful hack because python dbus need to guess the signature 121 data = [('', '')] #XXX: we have to this awful hack because python dbus need to guess the signature
121 return self.db_req_iface.gatewayRegister(action, target, data) 122 return self.db_req_iface.gatewayRegister(action, target, data)