Mercurial > libervia-backend
comparison src/bridge/DBus.py @ 371:3ea41a199b36
bridge refactoring: categories are now core and plugin instead of communication and request
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 06 Jul 2011 01:04:24 +0200 |
parents | efbfccfed623 |
children | e66d300c5d42 |
comparison
equal
deleted
inserted
replaced
370:68cdaf6d78e3 | 371:3ea41a199b36 |
---|---|
26 import dbus.mainloop.glib | 26 import dbus.mainloop.glib |
27 from logging import debug, info | 27 from logging import debug, info |
28 | 28 |
29 const_INT_PREFIX = "org.goffi.SAT" #Interface prefix | 29 const_INT_PREFIX = "org.goffi.SAT" #Interface prefix |
30 const_OBJ_PATH = '/org/goffi/SAT/bridge' | 30 const_OBJ_PATH = '/org/goffi/SAT/bridge' |
31 const_COMM_SUFFIX = ".communication" | 31 const_CORE_SUFFIX = ".core" |
32 const_REQ_SUFFIX = ".request" | 32 const_PLUGIN_SUFFIX = ".plugin" |
33 | 33 |
34 class DbusObject(dbus.service.Object): | 34 class DbusObject(dbus.service.Object): |
35 | 35 |
36 def __init__(self, bus, path): | 36 def __init__(self, bus, path): |
37 dbus.service.Object.__init__(self, bus, path) | 37 dbus.service.Object.__init__(self, bus, path) |
41 def register(self, name, cb): | 41 def register(self, name, cb): |
42 self.cb[name]=cb | 42 self.cb[name]=cb |
43 | 43 |
44 ### signals ### | 44 ### signals ### |
45 | 45 |
46 @dbus.service.signal(const_INT_PREFIX+const_REQ_SUFFIX, | 46 @dbus.service.signal(const_INT_PREFIX+const_PLUGIN_SUFFIX, |
47 signature='') | |
48 def dummySignal(self): | |
49 #FIXME: workaround for addSignal (doesn't work if one method doensn't | |
50 # already exist for plugins), probably missing some initialisation, need | |
51 # further investigations | |
52 pass | |
53 | |
54 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, | |
47 signature='ssa{ss}') | 55 signature='ssa{ss}') |
48 def actionResult(self, answer_type, id, data): | 56 def actionResult(self, answer_type, id, data): |
49 pass | 57 pass |
50 | 58 |
51 @dbus.service.signal(const_INT_PREFIX+const_REQ_SUFFIX, | 59 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
52 signature='ssa{sa{ss}}') | 60 signature='ssa{sa{ss}}') |
53 def actionResultExt(self, answer_type, id, data): | 61 def actionResultExt(self, answer_type, id, data): |
54 pass | 62 pass |
55 | 63 |
56 @dbus.service.signal(const_INT_PREFIX+const_REQ_SUFFIX, | 64 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
57 signature='ssa{ss}') | 65 signature='ssa{ss}') |
58 def askConfirmation(self, conf_type, id, data): | 66 def askConfirmation(self, conf_type, id, data): |
59 pass | 67 pass |
60 | 68 |
61 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, | 69 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
62 signature='s') | 70 signature='s') |
63 def connected(self, profile): | 71 def connected(self, profile): |
64 pass | 72 pass |
65 | 73 |
66 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, | 74 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
67 signature='ss') | 75 signature='ss') |
68 def connectionError(self, error_type, profile): | 76 def connectionError(self, error_type, profile): |
69 pass | 77 pass |
70 | 78 |
71 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, | 79 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
72 signature='ss') | 80 signature='ss') |
73 def contactDeleted(self, entity, profile): | 81 def contactDeleted(self, entity, profile): |
74 pass | 82 pass |
75 | 83 |
76 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, | 84 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
77 signature='s') | 85 signature='s') |
78 def disconnected(self, profile): | 86 def disconnected(self, profile): |
79 pass | 87 pass |
80 | 88 |
81 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, | 89 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
82 signature='ssss') | 90 signature='ssss') |
83 def newAlert(self, message, title, alert_type, profile): | 91 def newAlert(self, message, title, alert_type, profile): |
84 pass | 92 pass |
85 | 93 |
86 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, | 94 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
87 signature='sa{ss}ass') | 95 signature='sa{ss}ass') |
88 def newContact(self, contact, attributes, groups, profile): | 96 def newContact(self, contact, attributes, groups, profile): |
89 pass | 97 pass |
90 | 98 |
91 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, | 99 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
92 signature='sssss') | 100 signature='sssss') |
93 def newMessage(self, from_jid, message, mess_type, to_jid, profile): | 101 def newMessage(self, from_jid, message, mess_type, to_jid, profile): |
94 pass | 102 pass |
95 | 103 |
96 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, | 104 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
97 signature='ssss') | 105 signature='ssss') |
98 def paramUpdate(self, name, value, category, profile): | 106 def paramUpdate(self, name, value, category, profile): |
99 pass | 107 pass |
100 | 108 |
101 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, | 109 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
102 signature='ssia{ss}s') | 110 signature='ssia{ss}s') |
103 def presenceUpdate(self, entity, show, priority, statuses, profile): | 111 def presenceUpdate(self, entity, show, priority, statuses, profile): |
104 pass | 112 pass |
105 | 113 |
106 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, | 114 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
107 signature='sss') | 115 signature='sss') |
108 def subscribe(self, sub_type, entity, profile): | 116 def subscribe(self, sub_type, entity, profile): |
109 pass | 117 pass |
110 | 118 |
111 @dbus.service.signal(const_INT_PREFIX+const_REQ_SUFFIX, | 119 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
112 signature='sa{ss}') | 120 signature='sa{ss}s') |
113 def updatedValue(self, name, value): | 121 def updatedValue(self, name, value, profile): |
114 pass | 122 pass |
115 | 123 |
116 | 124 |
117 ### methods ### | 125 ### methods ### |
118 | 126 |
119 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 127 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
120 in_signature='ss', out_signature='', | 128 in_signature='ss', out_signature='', |
121 async_callbacks=None) | 129 async_callbacks=None) |
122 def addContact(self, entity, profile_key="@DEFAULT@"): | 130 def addContact(self, entity, profile_key="@DEFAULT@"): |
123 return self.cb["addContact"](unicode(entity), unicode(profile_key)) | 131 return self.cb["addContact"](unicode(entity), unicode(profile_key)) |
124 | 132 |
125 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 133 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
126 in_signature='s', out_signature='', | 134 in_signature='s', out_signature='', |
127 async_callbacks=('callback', 'errback')) | 135 async_callbacks=('callback', 'errback')) |
128 def asyncConnect(self, profile_key="@DEFAULT@", callback=None, errback=None): | 136 def asyncConnect(self, profile_key="@DEFAULT@", callback=None, errback=None): |
129 return self.cb["asyncConnect"](unicode(profile_key), callback, errback) | 137 return self.cb["asyncConnect"](unicode(profile_key), callback, errback) |
130 | 138 |
131 @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX, | 139 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
132 in_signature='ssss', out_signature='s', | 140 in_signature='ssss', out_signature='s', |
133 async_callbacks=None) | 141 async_callbacks=None) |
134 def callMenu(self, category, name, menu_type, profile_key): | 142 def callMenu(self, category, name, menu_type, profile_key): |
135 return self.cb["callMenu"](unicode(category), unicode(name), unicode(menu_type), unicode(profile_key)) | 143 return self.cb["callMenu"](unicode(category), unicode(name), unicode(menu_type), unicode(profile_key)) |
136 | 144 |
137 @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX, | 145 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
138 in_signature='sba{ss}', out_signature='', | 146 in_signature='sba{ss}', out_signature='', |
139 async_callbacks=None) | 147 async_callbacks=None) |
140 def confirmationAnswer(self, id, accepted, data): | 148 def confirmationAnswer(self, id, accepted, data): |
141 return self.cb["confirmationAnswer"](unicode(id), accepted, data) | 149 return self.cb["confirmationAnswer"](unicode(id), accepted, data) |
142 | 150 |
143 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 151 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
144 in_signature='s', out_signature='', | 152 in_signature='s', out_signature='', |
145 async_callbacks=None) | 153 async_callbacks=None) |
146 def connect(self, profile_key="@DEFAULT@"): | 154 def connect(self, profile_key="@DEFAULT@"): |
147 return self.cb["connect"](unicode(profile_key)) | 155 return self.cb["connect"](unicode(profile_key)) |
148 | 156 |
149 @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX, | 157 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
150 in_signature='s', out_signature='i', | 158 in_signature='s', out_signature='i', |
151 async_callbacks=None) | 159 async_callbacks=None) |
152 def createProfile(self, profile): | 160 def createProfile(self, profile): |
153 return self.cb["createProfile"](unicode(profile)) | 161 return self.cb["createProfile"](unicode(profile)) |
154 | 162 |
155 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 163 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
156 in_signature='ss', out_signature='', | 164 in_signature='ss', out_signature='', |
157 async_callbacks=None) | 165 async_callbacks=None) |
158 def delContact(self, entity, profile_key="@DEFAULT@"): | 166 def delContact(self, entity, profile_key="@DEFAULT@"): |
159 return self.cb["delContact"](unicode(entity), unicode(profile_key)) | 167 return self.cb["delContact"](unicode(entity), unicode(profile_key)) |
160 | 168 |
161 @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX, | 169 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
162 in_signature='s', out_signature='i', | 170 in_signature='s', out_signature='i', |
163 async_callbacks=None) | 171 async_callbacks=None) |
164 def deleteProfile(self, profile): | 172 def deleteProfile(self, profile): |
165 return self.cb["deleteProfile"](unicode(profile)) | 173 return self.cb["deleteProfile"](unicode(profile)) |
166 | 174 |
167 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 175 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
168 in_signature='s', out_signature='', | 176 in_signature='s', out_signature='', |
169 async_callbacks=None) | 177 async_callbacks=None) |
170 def disconnect(self, profile_key="@DEFAULT@"): | 178 def disconnect(self, profile_key="@DEFAULT@"): |
171 return self.cb["disconnect"](unicode(profile_key)) | 179 return self.cb["disconnect"](unicode(profile_key)) |
172 | 180 |
173 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 181 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
174 in_signature='ss', out_signature='s', | 182 in_signature='ss', out_signature='s', |
175 async_callbacks=None) | 183 async_callbacks=None) |
176 def getConfig(self, section, name): | 184 def getConfig(self, section, name): |
177 return self.cb["getConfig"](unicode(section), unicode(name)) | 185 return self.cb["getConfig"](unicode(section), unicode(name)) |
178 | 186 |
179 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 187 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
180 in_signature='s', out_signature='a(sa{ss}as)', | 188 in_signature='s', out_signature='a(sa{ss}as)', |
181 async_callbacks=None) | 189 async_callbacks=None) |
182 def getContacts(self, profile_key="@DEFAULT@"): | 190 def getContacts(self, profile_key="@DEFAULT@"): |
183 return self.cb["getContacts"](unicode(profile_key)) | 191 return self.cb["getContacts"](unicode(profile_key)) |
184 | 192 |
185 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 193 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
186 in_signature='ssi', out_signature='a{i(ss)}', | 194 in_signature='ssi', out_signature='a{i(ss)}', |
187 async_callbacks=None) | 195 async_callbacks=None) |
188 def getHistory(self, from_jid, to_jid, size): | 196 def getHistory(self, from_jid, to_jid, size): |
189 return self.cb["getHistory"](unicode(from_jid), unicode(to_jid), size) | 197 return self.cb["getHistory"](unicode(from_jid), unicode(to_jid), size) |
190 | 198 |
191 @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX, | 199 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
192 in_signature='sss', out_signature='s', | 200 in_signature='sss', out_signature='s', |
193 async_callbacks=None) | 201 async_callbacks=None) |
194 def getMenuHelp(self, category, name, menu_type): | 202 def getMenuHelp(self, category, name, menu_type): |
195 return self.cb["getMenuHelp"](unicode(category), unicode(name), unicode(menu_type)) | 203 return self.cb["getMenuHelp"](unicode(category), unicode(name), unicode(menu_type)) |
196 | 204 |
197 @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX, | 205 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
198 in_signature='', out_signature='a(sss)', | 206 in_signature='', out_signature='a(sss)', |
199 async_callbacks=None) | 207 async_callbacks=None) |
200 def getMenus(self, ): | 208 def getMenus(self, ): |
201 return self.cb["getMenus"]() | 209 return self.cb["getMenus"]() |
202 | 210 |
203 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 211 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
204 in_signature='ssss', out_signature='s', | 212 in_signature='ssss', out_signature='s', |
205 async_callbacks=None) | 213 async_callbacks=None) |
206 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"): | 214 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"): |
207 return self.cb["getParamA"](unicode(name), unicode(category), unicode(attribute), unicode(profile_key)) | 215 return self.cb["getParamA"](unicode(name), unicode(category), unicode(attribute), unicode(profile_key)) |
208 | 216 |
209 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 217 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
210 in_signature='s', out_signature='s', | 218 in_signature='s', out_signature='s', |
211 async_callbacks=None) | 219 async_callbacks=None) |
212 def getParams(self, profile_key="@DEFAULT@"): | 220 def getParams(self, profile_key="@DEFAULT@"): |
213 return self.cb["getParams"](unicode(profile_key)) | 221 return self.cb["getParams"](unicode(profile_key)) |
214 | 222 |
215 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 223 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
216 in_signature='', out_signature='as', | 224 in_signature='', out_signature='as', |
217 async_callbacks=None) | 225 async_callbacks=None) |
218 def getParamsCategories(self, ): | 226 def getParamsCategories(self, ): |
219 return self.cb["getParamsCategories"]() | 227 return self.cb["getParamsCategories"]() |
220 | 228 |
221 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 229 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
222 in_signature='ss', out_signature='s', | 230 in_signature='ss', out_signature='s', |
223 async_callbacks=None) | 231 async_callbacks=None) |
224 def getParamsForCategory(self, category, profile_key="@DEFAULT@"): | 232 def getParamsForCategory(self, category, profile_key="@DEFAULT@"): |
225 return self.cb["getParamsForCategory"](unicode(category), unicode(profile_key)) | 233 return self.cb["getParamsForCategory"](unicode(category), unicode(profile_key)) |
226 | 234 |
227 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 235 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
228 in_signature='s', out_signature='s', | 236 in_signature='s', out_signature='s', |
229 async_callbacks=None) | 237 async_callbacks=None) |
230 def getParamsUI(self, profile_key="@DEFAULT@"): | 238 def getParamsUI(self, profile_key="@DEFAULT@"): |
231 return self.cb["getParamsUI"](unicode(profile_key)) | 239 return self.cb["getParamsUI"](unicode(profile_key)) |
232 | 240 |
233 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 241 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
234 in_signature='s', out_signature='a{sa{s(sia{ss})}}', | 242 in_signature='s', out_signature='a{sa{s(sia{ss})}}', |
235 async_callbacks=None) | 243 async_callbacks=None) |
236 def getPresenceStatus(self, profile_key="@DEFAULT@"): | 244 def getPresenceStatus(self, profile_key="@DEFAULT@"): |
237 return self.cb["getPresenceStatus"](unicode(profile_key)) | 245 return self.cb["getPresenceStatus"](unicode(profile_key)) |
238 | 246 |
239 @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX, | 247 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
240 in_signature='s', out_signature='s', | 248 in_signature='s', out_signature='s', |
241 async_callbacks=None) | 249 async_callbacks=None) |
242 def getProfileName(self, profile_key="@DEFAULT@"): | 250 def getProfileName(self, profile_key="@DEFAULT@"): |
243 return self.cb["getProfileName"](unicode(profile_key)) | 251 return self.cb["getProfileName"](unicode(profile_key)) |
244 | 252 |
245 @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX, | 253 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
246 in_signature='', out_signature='as', | 254 in_signature='', out_signature='as', |
247 async_callbacks=None) | 255 async_callbacks=None) |
248 def getProfilesList(self, ): | 256 def getProfilesList(self, ): |
249 return self.cb["getProfilesList"]() | 257 return self.cb["getProfilesList"]() |
250 | 258 |
251 @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX, | 259 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
252 in_signature='s', out_signature='a{ss}', | 260 in_signature='s', out_signature='a{ss}', |
253 async_callbacks=None) | 261 async_callbacks=None) |
254 def getProgress(self, id): | 262 def getProgress(self, id): |
255 return self.cb["getProgress"](unicode(id)) | 263 return self.cb["getProgress"](unicode(id)) |
256 | 264 |
257 @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX, | 265 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
258 in_signature='', out_signature='s', | 266 in_signature='', out_signature='s', |
259 async_callbacks=None) | 267 async_callbacks=None) |
260 def getVersion(self, ): | 268 def getVersion(self, ): |
261 return self.cb["getVersion"]() | 269 return self.cb["getVersion"]() |
262 | 270 |
263 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 271 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
264 in_signature='s', out_signature='a{ss}', | 272 in_signature='s', out_signature='a{ss}', |
265 async_callbacks=None) | 273 async_callbacks=None) |
266 def getWaitingSub(self, profile_key="@DEFAULT@"): | 274 def getWaitingSub(self, profile_key="@DEFAULT@"): |
267 return self.cb["getWaitingSub"](unicode(profile_key)) | 275 return self.cb["getWaitingSub"](unicode(profile_key)) |
268 | 276 |
269 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 277 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
270 in_signature='s', out_signature='b', | 278 in_signature='s', out_signature='b', |
271 async_callbacks=None) | 279 async_callbacks=None) |
272 def isConnected(self, profile_key="@DEFAULT@"): | 280 def isConnected(self, profile_key="@DEFAULT@"): |
273 return self.cb["isConnected"](unicode(profile_key)) | 281 return self.cb["isConnected"](unicode(profile_key)) |
274 | 282 |
275 @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX, | 283 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
276 in_signature='sa{ss}s', out_signature='s', | 284 in_signature='sa{ss}s', out_signature='s', |
277 async_callbacks=None) | 285 async_callbacks=None) |
278 def launchAction(self, action_type, data, profile_key="@DEFAULT@"): | 286 def launchAction(self, action_type, data, profile_key="@DEFAULT@"): |
279 return self.cb["launchAction"](unicode(action_type), data, unicode(profile_key)) | 287 return self.cb["launchAction"](unicode(action_type), data, unicode(profile_key)) |
280 | 288 |
281 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 289 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
282 in_signature='ssssi', out_signature='s', | 290 in_signature='ssssi', out_signature='s', |
283 async_callbacks=None) | 291 async_callbacks=None) |
284 def registerNewAccount(self, login, password, email, host, port=5222): | 292 def registerNewAccount(self, login, password, email, host, port=5222): |
285 return self.cb["registerNewAccount"](unicode(login), unicode(password), unicode(email), unicode(host), port) | 293 return self.cb["registerNewAccount"](unicode(login), unicode(password), unicode(email), unicode(host), port) |
286 | 294 |
287 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 295 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
288 in_signature='sssss', out_signature='', | 296 in_signature='sssss', out_signature='', |
289 async_callbacks=None) | 297 async_callbacks=None) |
290 def sendMessage(self, to_jid, message, subject='', mess_type="chat", profile_key="@DEFAULT@"): | 298 def sendMessage(self, to_jid, message, subject='', mess_type="chat", profile_key="@DEFAULT@"): |
291 return self.cb["sendMessage"](unicode(to_jid), unicode(message), unicode(subject), unicode(mess_type), unicode(profile_key)) | 299 return self.cb["sendMessage"](unicode(to_jid), unicode(message), unicode(subject), unicode(mess_type), unicode(profile_key)) |
292 | 300 |
293 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 301 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
294 in_signature='ssss', out_signature='', | 302 in_signature='ssss', out_signature='', |
295 async_callbacks=None) | 303 async_callbacks=None) |
296 def setParam(self, name, value, category, profile_key="@DEFAULT@"): | 304 def setParam(self, name, value, category, profile_key="@DEFAULT@"): |
297 return self.cb["setParam"](unicode(name), unicode(value), unicode(category), unicode(profile_key)) | 305 return self.cb["setParam"](unicode(name), unicode(value), unicode(category), unicode(profile_key)) |
298 | 306 |
299 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 307 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
300 in_signature='ssia{ss}s', out_signature='', | 308 in_signature='ssia{ss}s', out_signature='', |
301 async_callbacks=None) | 309 async_callbacks=None) |
302 def setPresence(self, to_jid='', show='', priority=0, statuses={}, profile_key="@DEFAULT@"): | 310 def setPresence(self, to_jid='', show='', priority=0, statuses={}, profile_key="@DEFAULT@"): |
303 return self.cb["setPresence"](unicode(to_jid), unicode(show), priority, statuses, unicode(profile_key)) | 311 return self.cb["setPresence"](unicode(to_jid), unicode(show), priority, statuses, unicode(profile_key)) |
304 | 312 |
305 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 313 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
306 in_signature='sss', out_signature='', | 314 in_signature='sss', out_signature='', |
307 async_callbacks=None) | 315 async_callbacks=None) |
308 def subscription(self, sub_type, entity, profile_key="@DEFAULT@"): | 316 def subscription(self, sub_type, entity, profile_key="@DEFAULT@"): |
309 return self.cb["subscription"](unicode(sub_type), unicode(entity), unicode(profile_key)) | 317 return self.cb["subscription"](unicode(sub_type), unicode(entity), unicode(profile_key)) |
310 | 318 |
311 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, | 319 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
312 in_signature='ssass', out_signature='', | 320 in_signature='ssass', out_signature='', |
313 async_callbacks=None) | 321 async_callbacks=None) |
314 def updateContact(self, entity, name, groups, profile_key="@DEFAULT@"): | 322 def updateContact(self, entity, name, groups, profile_key="@DEFAULT@"): |
315 return self.cb["updateContact"](unicode(entity), unicode(name), groups, unicode(profile_key)) | 323 return self.cb["updateContact"](unicode(entity), unicode(name), groups, unicode(profile_key)) |
316 | 324 |
431 self.dbus_bridge.presenceUpdate(entity, show, priority, statuses, profile) | 439 self.dbus_bridge.presenceUpdate(entity, show, priority, statuses, profile) |
432 | 440 |
433 def subscribe(self, sub_type, entity, profile): | 441 def subscribe(self, sub_type, entity, profile): |
434 self.dbus_bridge.subscribe(sub_type, entity, profile) | 442 self.dbus_bridge.subscribe(sub_type, entity, profile) |
435 | 443 |
436 def updatedValue(self, name, value): | 444 def updatedValue(self, name, value, profile): |
437 self.dbus_bridge.updatedValue(name, value) | 445 self.dbus_bridge.updatedValue(name, value, profile) |
438 | 446 |
439 | 447 |
440 def register(self, name, callback): | 448 def register(self, name, callback): |
441 debug("registering DBus bridge method [%s]", name) | 449 debug("registering DBus bridge method [%s]", name) |
442 self.dbus_bridge.register(name, callback) | 450 self.dbus_bridge.register(name, callback) |