annotate frontends/sat_bridge_frontend/DBus.py @ 166:b318d2b58887

Primitivus: parameters management via XMLUI
author Goffi <goffi@goffi.org>
date Mon, 09 Aug 2010 21:39:41 +0800
parents 8a2053de6f8c
children 96af1bec2e68
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
goffi@necton2
parents:
diff changeset
1 #!/usr/bin/python
goffi@necton2
parents:
diff changeset
2 #-*- coding: utf-8 -*-
goffi@necton2
parents:
diff changeset
3
goffi@necton2
parents:
diff changeset
4 """
goffi@necton2
parents:
diff changeset
5 SAT communication bridge
57
a5b5fb5fc9fd updated README and copyright note
Goffi <goffi@goffi.org>
parents: 51
diff changeset
6 Copyright (C) 2009, 2010 Jérôme Poisson (goffi@goffi.org)
0
goffi@necton2
parents:
diff changeset
7
goffi@necton2
parents:
diff changeset
8 This program is free software: you can redistribute it and/or modify
goffi@necton2
parents:
diff changeset
9 it under the terms of the GNU General Public License as published by
goffi@necton2
parents:
diff changeset
10 the Free Software Foundation, either version 3 of the License, or
goffi@necton2
parents:
diff changeset
11 (at your option) any later version.
goffi@necton2
parents:
diff changeset
12
goffi@necton2
parents:
diff changeset
13 This program is distributed in the hope that it will be useful,
goffi@necton2
parents:
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
goffi@necton2
parents:
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
goffi@necton2
parents:
diff changeset
16 GNU General Public License for more details.
goffi@necton2
parents:
diff changeset
17
goffi@necton2
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
goffi@necton2
parents:
diff changeset
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
goffi@necton2
parents:
diff changeset
20 """
goffi@necton2
parents:
diff changeset
21
goffi@necton2
parents:
diff changeset
22 from bridge_frontend import BridgeFrontend
goffi@necton2
parents:
diff changeset
23 import dbus, dbus.glib
goffi@necton2
parents:
diff changeset
24
165
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
25 class BridgeExceptionNoService(Exception):
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
26 pass
0
goffi@necton2
parents:
diff changeset
27
goffi@necton2
parents:
diff changeset
28 class DBusBridgeFrontend(BridgeFrontend):
goffi@necton2
parents:
diff changeset
29 def __init__(self):
165
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
30 try:
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
31 self.sessions_bus = dbus.SessionBus()
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
32 self.db_object = self.sessions_bus.get_object('org.goffi.SAT',
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
33 '/org/goffi/SAT/bridge')
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
34 self.db_comm_iface = dbus.Interface(self.db_object,
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
35 dbus_interface='org.goffi.SAT.communication')
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
36 self.db_req_iface = dbus.Interface(self.db_object,
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
37 dbus_interface='org.goffi.SAT.request')
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
38 except dbus.exceptions.DBusException,e:
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
39 if e._dbus_error_name=='org.freedesktop.DBus.Error.ServiceUnknown':
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
40 raise BridgeExceptionNoService
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
41 else:
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
42 raise e
0
goffi@necton2
parents:
diff changeset
43 #props = self.db_comm_iface.getProperties()
goffi@necton2
parents:
diff changeset
44
goffi@necton2
parents:
diff changeset
45 def register(self, functionName, handler, iface="communication"):
goffi@necton2
parents:
diff changeset
46 if iface == "communication":
goffi@necton2
parents:
diff changeset
47 self.db_comm_iface.connect_to_signal(functionName, handler)
goffi@necton2
parents:
diff changeset
48 elif iface == "request":
goffi@necton2
parents:
diff changeset
49 self.db_req_iface.connect_to_signal(functionName, handler)
goffi@necton2
parents:
diff changeset
50
119
ded2431cea5a Primitivus: chat window / text sending.
Goffi <goffi@goffi.org>
parents: 105
diff changeset
51 def getVersion(self):
ded2431cea5a Primitivus: chat window / text sending.
Goffi <goffi@goffi.org>
parents: 105
diff changeset
52 return self.db_req_iface.getVersion()
ded2431cea5a Primitivus: chat window / text sending.
Goffi <goffi@goffi.org>
parents: 105
diff changeset
53
66
8147b4f40809 SàT: multi-profile: DBus signals and frontend adaptation (first draft)
Goffi <goffi@goffi.org>
parents: 65
diff changeset
54 def getProfileName(self, profile_key='@DEFAULT@'):
8147b4f40809 SàT: multi-profile: DBus signals and frontend adaptation (first draft)
Goffi <goffi@goffi.org>
parents: 65
diff changeset
55 return self.db_req_iface.getProfileName(profile_key)
8147b4f40809 SàT: multi-profile: DBus signals and frontend adaptation (first draft)
Goffi <goffi@goffi.org>
parents: 65
diff changeset
56
8147b4f40809 SàT: multi-profile: DBus signals and frontend adaptation (first draft)
Goffi <goffi@goffi.org>
parents: 65
diff changeset
57 def getProfilesList(self):
8147b4f40809 SàT: multi-profile: DBus signals and frontend adaptation (first draft)
Goffi <goffi@goffi.org>
parents: 65
diff changeset
58 return self.db_req_iface.getProfilesList()
8147b4f40809 SàT: multi-profile: DBus signals and frontend adaptation (first draft)
Goffi <goffi@goffi.org>
parents: 65
diff changeset
59
68
9b842086d915 multiple profiles update
Goffi <goffi@goffi.org>
parents: 67
diff changeset
60 def createProfile(self, name):
9b842086d915 multiple profiles update
Goffi <goffi@goffi.org>
parents: 67
diff changeset
61 return self.db_req_iface.createProfile(name)
9b842086d915 multiple profiles update
Goffi <goffi@goffi.org>
parents: 67
diff changeset
62
9b842086d915 multiple profiles update
Goffi <goffi@goffi.org>
parents: 67
diff changeset
63 def deleteProfile(self, name):
9b842086d915 multiple profiles update
Goffi <goffi@goffi.org>
parents: 67
diff changeset
64 return self.db_req_iface.deleteProfile(name)
66
8147b4f40809 SàT: multi-profile: DBus signals and frontend adaptation (first draft)
Goffi <goffi@goffi.org>
parents: 65
diff changeset
65
65
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
66 def connect(self, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
67 return self.db_comm_iface.connect(profile_key)
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
68
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
69 def disconnect(self, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
70 return self.db_comm_iface.disconnect(profile_key)
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
71
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
72 def isConnected(self, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
73 return self.db_comm_iface.isConnected(profile_key)
0
goffi@necton2
parents:
diff changeset
74
65
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
75 def getContacts(self, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
76 return self.db_comm_iface.getContacts(profile_key)
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
77
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
78 def getPresenceStatus(self, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
79 return self.db_comm_iface.getPresenceStatus(profile_key)
1
a06a151fc31f Disconnect first draft
Goffi <goffi@goffi.org>
parents: 0
diff changeset
80
65
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
81 def getWaitingSub(self, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
82 return self.db_comm_iface.getWaitingSub(profile_key)
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
83
67
0e50dd3a234a message sending bug fixes + sortilege update
Goffi <goffi@goffi.org>
parents: 66
diff changeset
84 def sendMessage(self, to, message, type='chat', profile_key='@DEFAULT@'):
0e50dd3a234a message sending bug fixes + sortilege update
Goffi <goffi@goffi.org>
parents: 66
diff changeset
85 return self.db_comm_iface.sendMessage(to, message, type, profile_key)
65
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
86
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
87 def setPresence(self, to="", show="", priority=0, statuses={}, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
88 return self.db_comm_iface.setPresence(to, show, priority, statuses, profile_key)
0
goffi@necton2
parents:
diff changeset
89
65
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
90 def subscription(self, type, entity, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
91 return self.db_comm_iface.subscription(type, entity, profile_key)
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
92
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
93 def setParam(self, name, value, category, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
94 return self.db_comm_iface.setParam(name, value, category, profile_key)
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
95
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
96 def getParamA(self, name, category, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
97 return self.db_comm_iface.getParamA(name, category, profile_key)
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
98
105
d2630fba8dfd params to XMLUI tools
Goffi <goffi@goffi.org>
parents: 101
diff changeset
99 def getParamsUI(self, profile_key='@DEFAULT@'):
d2630fba8dfd params to XMLUI tools
Goffi <goffi@goffi.org>
parents: 101
diff changeset
100 return self.db_comm_iface.getParamsUI(profile_key)
d2630fba8dfd params to XMLUI tools
Goffi <goffi@goffi.org>
parents: 101
diff changeset
101
65
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
102 def getParams(self, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
103 return self.db_comm_iface.getParams(profile_key)
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
104
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
105 def getParamsForCategory(self, category, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
106 return self.db_comm_iface.getParamsForCategory(category, profile_key)
0
goffi@necton2
parents:
diff changeset
107
65
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
108 def getParamsCategories(self):
66
8147b4f40809 SàT: multi-profile: DBus signals and frontend adaptation (first draft)
Goffi <goffi@goffi.org>
parents: 65
diff changeset
109 return self.db_comm_iface.getParamsCategories()
51
8c67ea98ab91 frontend improved to take into account new SàT features
Goffi <goffi@goffi.org>
parents: 43
diff changeset
110
65
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
111 def getHistory(self, from_jid, to_jid, size):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
112 return self.db_comm_iface.getHistory(from_jid, to_jid, size)
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
113
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
114 def addContact(self, jid, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
115 return self.db_comm_iface.addContact(jid, profile_key)
0
goffi@necton2
parents:
diff changeset
116
65
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
117 def delContact(self, jid, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
118 return self.db_comm_iface.delContact(jid, profile_key)
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
119
136
d6c0fe7489af frontend DBus bridge: added profile management for launchAction method
Goffi <goffi@goffi.org>
parents: 119
diff changeset
120 def launchAction(self, type, data, profile_key='@DEFAULT@'):
d6c0fe7489af frontend DBus bridge: added profile management for launchAction method
Goffi <goffi@goffi.org>
parents: 119
diff changeset
121 return self.db_req_iface.launchAction(type, data, profile_key)
65
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
122
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
123 def confirmationAnswer(self, id, accepted, data):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
124 return self.db_req_iface.confirmationAnswer(id, accepted, data)
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
125
101
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
126 def getProgress(self, id):
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
127 return self.db_req_iface.getProgress(id)
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
128
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
129 def getMenus(self):
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
130 return self.db_req_iface.getMenus()
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
131
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
132 def getMenuHelp(self, category, name, type="NORMAL"):
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
133 return self.db_req_iface.getMenuHelp(category, name, type)
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
134
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
135 def callMenu(self, category, name, type="NORMAL", profile_key='@DEFAULT@'):
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
136 return self.db_req_iface.callMenu(category, name, type, profile_key)
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
137
65
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
138 #methods from plugins
78
ace2af8abc5a Added method to know which MUC are joined, and which subjects were received.
Goffi <goffi@goffi.org>
parents: 72
diff changeset
139 def getRoomJoined(self, profile_key='@DEFAULT@'):
ace2af8abc5a Added method to know which MUC are joined, and which subjects were received.
Goffi <goffi@goffi.org>
parents: 72
diff changeset
140 return self.db_comm_iface.getRoomJoined(profile_key)
ace2af8abc5a Added method to know which MUC are joined, and which subjects were received.
Goffi <goffi@goffi.org>
parents: 72
diff changeset
141
ace2af8abc5a Added method to know which MUC are joined, and which subjects were received.
Goffi <goffi@goffi.org>
parents: 72
diff changeset
142 def getRoomSubjects(self, profile_key='@DEFAULT@'):
ace2af8abc5a Added method to know which MUC are joined, and which subjects were received.
Goffi <goffi@goffi.org>
parents: 72
diff changeset
143 return self.db_comm_iface.getRoomSubjects(profile_key)
ace2af8abc5a Added method to know which MUC are joined, and which subjects were received.
Goffi <goffi@goffi.org>
parents: 72
diff changeset
144
72
f271fff3a713 MUC implementation: first draft
Goffi <goffi@goffi.org>
parents: 68
diff changeset
145 def joinMUC(self, service, roomId, nick, profile_key='@DEFAULT@'):
f271fff3a713 MUC implementation: first draft
Goffi <goffi@goffi.org>
parents: 68
diff changeset
146 return self.db_comm_iface.joinMUC(service, roomId, nick, profile_key)
f271fff3a713 MUC implementation: first draft
Goffi <goffi@goffi.org>
parents: 68
diff changeset
147
90
4020931569b8 Tarot Game: session initialization
Goffi <goffi@goffi.org>
parents: 85
diff changeset
148 def tarotGameCreate(self, room_jid, players, profile_key='@DEFAULT@'):
4020931569b8 Tarot Game: session initialization
Goffi <goffi@goffi.org>
parents: 85
diff changeset
149 return self.db_comm_iface.tarotGameCreate(room_jid, players, profile_key)
4020931569b8 Tarot Game: session initialization
Goffi <goffi@goffi.org>
parents: 85
diff changeset
150
92
2503de7fb4c7 Tarot game: chien/écart stage
Goffi <goffi@goffi.org>
parents: 91
diff changeset
151 def tarotGameReady(self, player, referee, profile_key='@DEFAULT@'):
2503de7fb4c7 Tarot game: chien/écart stage
Goffi <goffi@goffi.org>
parents: 91
diff changeset
152 return self.db_comm_iface.tarotGameReady(player, referee, profile_key)
85
fc7583282d40 Tarot Game plugin: first draft
Goffi <goffi@goffi.org>
parents: 78
diff changeset
153
92
2503de7fb4c7 Tarot game: chien/écart stage
Goffi <goffi@goffi.org>
parents: 91
diff changeset
154 def tarotGameContratChoosed(self, player, referee, contrat, profile_key='@DEFAULT@'):
2503de7fb4c7 Tarot game: chien/écart stage
Goffi <goffi@goffi.org>
parents: 91
diff changeset
155 return self.db_comm_iface.tarotGameContratChoosed(player, referee, contrat, profile_key)
2503de7fb4c7 Tarot game: chien/écart stage
Goffi <goffi@goffi.org>
parents: 91
diff changeset
156
2503de7fb4c7 Tarot game: chien/écart stage
Goffi <goffi@goffi.org>
parents: 91
diff changeset
157 def tarotGamePlayCards(self, player, referee, cards, profile_key='@DEFAULT@'):
2503de7fb4c7 Tarot game: chien/écart stage
Goffi <goffi@goffi.org>
parents: 91
diff changeset
158 return self.db_comm_iface.tarotGamePlayCards(player, referee, cards, profile_key)
91
39c672544593 Tarot: bidding phase
Goffi <goffi@goffi.org>
parents: 90
diff changeset
159
64
d46f849664aa SàT: multi-profile, plugins updated
Goffi <goffi@goffi.org>
parents: 57
diff changeset
160 def sendFile(self, to, path, profile_key='@DEFAULT@'):
d46f849664aa SàT: multi-profile, plugins updated
Goffi <goffi@goffi.org>
parents: 57
diff changeset
161 return self.db_comm_iface.sendFile(to, path, profile_key)
0
goffi@necton2
parents:
diff changeset
162
65
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
163 def findGateways(self, target, profile_key='@DEFAULT@'):
d35c5edab53f SàT: multi-profile: memory & dbus bridge's methods profile management
Goffi <goffi@goffi.org>
parents: 64
diff changeset
164 return self.db_comm_iface.findGateways(target, profile_key)
25
53e921c8a357 new plugin: gateways plugin, and first implementation of findGateways
Goffi <goffi@goffi.org>
parents: 22
diff changeset
165
64
d46f849664aa SàT: multi-profile, plugins updated
Goffi <goffi@goffi.org>
parents: 57
diff changeset
166 def getCard(self, target, profile_key='@DEFAULT@'):
d46f849664aa SàT: multi-profile, plugins updated
Goffi <goffi@goffi.org>
parents: 57
diff changeset
167 return self.db_comm_iface.getCard(target, profile_key)
42
874de3020e1c Initial VCard (XEP-0054) support + misc fixes
Goffi <goffi@goffi.org>
parents: 37
diff changeset
168
64
d46f849664aa SàT: multi-profile, plugins updated
Goffi <goffi@goffi.org>
parents: 57
diff changeset
169 def getCardCache(self, target):
d46f849664aa SàT: multi-profile, plugins updated
Goffi <goffi@goffi.org>
parents: 57
diff changeset
170 return self.db_comm_iface.getCardCache(target)
51
8c67ea98ab91 frontend improved to take into account new SàT features
Goffi <goffi@goffi.org>
parents: 43
diff changeset
171
43
8a438a6ff587 Wix: added avatar in profile
Goffi <goffi@goffi.org>
parents: 42
diff changeset
172 def getAvatarFile(self, hash):
8a438a6ff587 Wix: added avatar in profile
Goffi <goffi@goffi.org>
parents: 42
diff changeset
173 return self.db_comm_iface.getAvatarFile(hash)
8a438a6ff587 Wix: added avatar in profile
Goffi <goffi@goffi.org>
parents: 42
diff changeset
174
64
d46f849664aa SàT: multi-profile, plugins updated
Goffi <goffi@goffi.org>
parents: 57
diff changeset
175 def in_band_register(self, target, profile_key='@DEFAULT@'):
d46f849664aa SàT: multi-profile, plugins updated
Goffi <goffi@goffi.org>
parents: 57
diff changeset
176 return self.db_comm_iface.in_band_register(target, profile_key)
0
goffi@necton2
parents:
diff changeset
177
37
a61beb21d16d Gateway registration, unregistration & edition
Goffi <goffi@goffi.org>
parents: 36
diff changeset
178 def gatewayRegister(self, action, target, data):
a61beb21d16d Gateway registration, unregistration & edition
Goffi <goffi@goffi.org>
parents: 36
diff changeset
179 if data == None:
101
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
180 data = [('', '')] #XXX: we have to do this awful hack because python dbus need to guess the signature
37
a61beb21d16d Gateway registration, unregistration & edition
Goffi <goffi@goffi.org>
parents: 36
diff changeset
181 return self.db_req_iface.gatewayRegister(action, target, data)
36
6491b7956c80 wix: Form submitting, first draft
Goffi <goffi@goffi.org>
parents: 30
diff changeset
182
101
783e9d6980ec Couchsurfing plugin: first draft
Goffi <goffi@goffi.org>
parents: 92
diff changeset
183