annotate tools/memory.py @ 17:74a39f40eb6d

refactoring: using xml params (not finished yet)
author Goffi <goffi@goffi.org>
date Fri, 06 Nov 2009 19:48:57 +0100
parents a62d7d453f22
children 6928e3cb73a8
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: a jabber client
goffi@necton2
parents:
diff changeset
6 Copyright (C) 2009 Jérôme Poisson (goffi@goffi.org)
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 __future__ import with_statement
goffi@necton2
parents:
diff changeset
23
goffi@necton2
parents:
diff changeset
24 import os.path
goffi@necton2
parents:
diff changeset
25 import time
goffi@necton2
parents:
diff changeset
26 import pickle
17
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
27 from xml.dom import minidom
0
goffi@necton2
parents:
diff changeset
28 from logging import debug, info, error
17
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
29 import pdb
0
goffi@necton2
parents:
diff changeset
30
goffi@necton2
parents:
diff changeset
31 const_SAVEFILE_PARAM=os.path.expanduser("~/.sat_param.save")
goffi@necton2
parents:
diff changeset
32 const_SAVEFILE_HISTORY=os.path.expanduser("~/.sat_history.save")
goffi@necton2
parents:
diff changeset
33
17
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
34 class Param():
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
35 """This class manage parameter with xml"""
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
36
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
37 #TODO: mettre Watched dans un plugin
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
38 default_xml = """
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
39 <params>
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
40 <category name="Connection">
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
41 <param name="JabberID" value="goffi@jabber.goffi.int/TestScript" type="string" />
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
42 <param name="Password" value="toto" type="password" />
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
43 <param name="Server" value="jabber.goffi.int" type="string" />
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
44 </category>
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
45 <category name="File Transfert">
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
46 <param name="IP" value="192.168.0.10" type="string" />
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
47 <param name="Port" value="28915" type="string" />
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
48 </category>
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
49 <category name="Misc">
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
50 <param name="Watched" value="test@Jabber.goffi.int" type="string" />
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
51 </category>
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
52 </params>
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
53 """
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
54
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
55 def load_default_params(self):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
56 self.dom = minidom.parseString(Param.default_xml)
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
57
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
58 def __init__(self):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
59 debug("Parameters init")
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
60 self.load_default_params()
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
61
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
62
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
63 def getParamV(self, name, category):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
64 """Helper method to get the value in the good type
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
65 getParamV stands for GetParamValue"""
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
66 node = self.__getParamNode(name, category)
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
67 if not node:
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
68 error("Requested param [%s] in category [%s] doesn't exist !" , name, category)
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
69 return none
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
70 return node.getAttribute("value")
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
71
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
72 def getParams(self):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
73 """Return the wold params XML"""
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
74 return self.dom.toxml()
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
75
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
76
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
77 """def getParam(self, name, category):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
78 if self.params.has_key(namespace) and self.params[namespace].has_key(name):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
79 return self.params[namespace][name]
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
80 return ["",""]"""
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
81
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
82 def __getParamNode(self, name, category):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
83 for node in self.dom.documentElement.childNodes:
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
84 if node.nodeName == "category" and node.getAttribute("name") == category:
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
85 params = node.getElementsByTagName("param")
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
86 for param in params:
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
87 if param.getAttribute("name") == name:
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
88 return param
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
89 return None
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
90
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
91
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
92 """def getParams(self, namespace):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
93 if self.params.has_key(namespace):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
94 ret=[]
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
95 for name in self.params[namespace]:
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
96 ret.append([name] + self.params[namespace][name])
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
97 return ret
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
98 return [[]]"""
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
99
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
100 def getParamsCategories(self):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
101 """return the categories availables"""
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
102 categories=[]
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
103 for cat in self.dom.getElementsByTagName("category"):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
104 categories.append(cat.getAttribute("name"))
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
105 return categories
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
106
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
107 def setParam(self, name, value, category):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
108 node = self.__getParamNode(name, category)
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
109 if not node:
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
110 return #TODO: throw an error
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
111 node.setAttribute(name, value)
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
112
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
113 """def createParam (self, name, value, type, namespace):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
114 ### TODO: add desciption in params
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
115 if not self.params.has_key(namespace):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
116 self.params[namespace]={}
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
117 self.params[namespace][name]=[value,type];"""
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
118
0
goffi@necton2
parents:
diff changeset
119 class Memory:
goffi@necton2
parents:
diff changeset
120 """This class manage all persistent informations"""
goffi@necton2
parents:
diff changeset
121
goffi@necton2
parents:
diff changeset
122 def __init__(self):
goffi@necton2
parents:
diff changeset
123 info ("Memory manager init")
goffi@necton2
parents:
diff changeset
124 self.contact={}
goffi@necton2
parents:
diff changeset
125 self.presenceStatus={}
17
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
126 self.params=Param()
0
goffi@necton2
parents:
diff changeset
127 self.history={}
goffi@necton2
parents:
diff changeset
128 self.disco={} #XXX: maybe best in a separate class
goffi@necton2
parents:
diff changeset
129 self.features={}
goffi@necton2
parents:
diff changeset
130 self.load()
goffi@necton2
parents:
diff changeset
131
goffi@necton2
parents:
diff changeset
132 def load(self):
goffi@necton2
parents:
diff changeset
133 """Load parameters and all memory things from file/db"""
goffi@necton2
parents:
diff changeset
134
goffi@necton2
parents:
diff changeset
135 #first parameters
goffi@necton2
parents:
diff changeset
136 if os.path.exists(const_SAVEFILE_PARAM):
goffi@necton2
parents:
diff changeset
137 try:
goffi@necton2
parents:
diff changeset
138 with open(const_SAVEFILE_PARAM, 'r') as params_pickle:
goffi@necton2
parents:
diff changeset
139 self.params=pickle.load(params_pickle)
goffi@necton2
parents:
diff changeset
140 debug("params loaded")
goffi@necton2
parents:
diff changeset
141 except:
goffi@necton2
parents:
diff changeset
142 error ("Can't load params !")
17
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
143 self.params.load_default_params()
0
goffi@necton2
parents:
diff changeset
144 else:
17
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
145 self.params.load_default_params()
0
goffi@necton2
parents:
diff changeset
146
goffi@necton2
parents:
diff changeset
147 #history
goffi@necton2
parents:
diff changeset
148 if os.path.exists(const_SAVEFILE_HISTORY):
goffi@necton2
parents:
diff changeset
149 try:
goffi@necton2
parents:
diff changeset
150 with open(const_SAVEFILE_HISTORY, 'r') as history_pickle:
goffi@necton2
parents:
diff changeset
151 self.history=pickle.load(history_pickle)
goffi@necton2
parents:
diff changeset
152 debug("history loaded")
goffi@necton2
parents:
diff changeset
153 except:
goffi@necton2
parents:
diff changeset
154 error ("Can't load history !")
goffi@necton2
parents:
diff changeset
155
goffi@necton2
parents:
diff changeset
156
goffi@necton2
parents:
diff changeset
157 def save(self):
goffi@necton2
parents:
diff changeset
158 """Save parameters and all memory things to file/db"""
goffi@necton2
parents:
diff changeset
159 with open(const_SAVEFILE_PARAM, 'w') as params_pickle:
goffi@necton2
parents:
diff changeset
160 pickle.dump(self.params, params_pickle)
goffi@necton2
parents:
diff changeset
161 with open(const_SAVEFILE_HISTORY, 'w') as history_pickle:
goffi@necton2
parents:
diff changeset
162 pickle.dump(self.history, history_pickle)
goffi@necton2
parents:
diff changeset
163
goffi@necton2
parents:
diff changeset
164 def addToHistory(self, me_jid, from_jid, to_jid, type, message):
goffi@necton2
parents:
diff changeset
165 me_short=me_jid.userhost()
goffi@necton2
parents:
diff changeset
166 from_short=from_jid.userhost()
goffi@necton2
parents:
diff changeset
167 to_short=to_jid.userhost()
goffi@necton2
parents:
diff changeset
168
goffi@necton2
parents:
diff changeset
169 if from_jid==me_jid:
goffi@necton2
parents:
diff changeset
170 key=to_short
goffi@necton2
parents:
diff changeset
171 else:
goffi@necton2
parents:
diff changeset
172 key=from_short
goffi@necton2
parents:
diff changeset
173
goffi@necton2
parents:
diff changeset
174 if not self.history.has_key(me_short):
goffi@necton2
parents:
diff changeset
175 self.history[me_short]={}
goffi@necton2
parents:
diff changeset
176 if not self.history[me_short].has_key(key):
goffi@necton2
parents:
diff changeset
177 self.history[me_short][key]={}
goffi@necton2
parents:
diff changeset
178
goffi@necton2
parents:
diff changeset
179 self.history[me_short][key][int(time.time())] = (from_short, message)
goffi@necton2
parents:
diff changeset
180
goffi@necton2
parents:
diff changeset
181 def getHistory(self, from_jid, to_jid, size):
goffi@necton2
parents:
diff changeset
182 ret={}
goffi@necton2
parents:
diff changeset
183 if not self.history.has_key(from_jid):
goffi@necton2
parents:
diff changeset
184 error("source JID not found !")
goffi@necton2
parents:
diff changeset
185 #TODO: throw an error here
goffi@necton2
parents:
diff changeset
186 return {}
goffi@necton2
parents:
diff changeset
187 if not self.history[from_jid].has_key(to_jid):
goffi@necton2
parents:
diff changeset
188 error("dest JID not found !")
goffi@necton2
parents:
diff changeset
189 #TODO: throw an error here
goffi@necton2
parents:
diff changeset
190 return {}
goffi@necton2
parents:
diff changeset
191 stamps=self.history[from_jid][to_jid].keys()
goffi@necton2
parents:
diff changeset
192 stamps.sort()
goffi@necton2
parents:
diff changeset
193 for stamp in stamps[-size:]:
goffi@necton2
parents:
diff changeset
194 ret[stamp]=self.history[from_jid][to_jid][stamp]
goffi@necton2
parents:
diff changeset
195
goffi@necton2
parents:
diff changeset
196 return ret
goffi@necton2
parents:
diff changeset
197
goffi@necton2
parents:
diff changeset
198 def addContact(self, JID, attributes, groups):
goffi@necton2
parents:
diff changeset
199 debug("Memory addContact: %s",JID)
goffi@necton2
parents:
diff changeset
200 assert(isinstance(attributes,dict))
13
bd9e9997d540 wokkel integration (not finished yet)
Goffi <goffi@goffi.org>
parents: 0
diff changeset
201 assert(isinstance(groups,set))
0
goffi@necton2
parents:
diff changeset
202 self.contact[JID]=[attributes, groups]
goffi@necton2
parents:
diff changeset
203
goffi@necton2
parents:
diff changeset
204 def addPresenceStatus(self, jid, type, show, status, priority):
goffi@necton2
parents:
diff changeset
205 self.presenceStatus[jid]=[type, show, status, priority]
goffi@necton2
parents:
diff changeset
206
goffi@necton2
parents:
diff changeset
207 def getContacts(self):
goffi@necton2
parents:
diff changeset
208 debug ("Memory getContact OK (%s)", self.contact)
goffi@necton2
parents:
diff changeset
209 ret=[]
goffi@necton2
parents:
diff changeset
210 for contact in self.contact:
goffi@necton2
parents:
diff changeset
211 ret.append([contact] + [self.contact[contact][0]] + [self.contact[contact][1]]) #very ugly I know !
goffi@necton2
parents:
diff changeset
212 return ret
goffi@necton2
parents:
diff changeset
213
goffi@necton2
parents:
diff changeset
214 def getPresenceStatus(self):
goffi@necton2
parents:
diff changeset
215 status=[]
goffi@necton2
parents:
diff changeset
216 for contact, contactStatus in self.presenceStatus.items():
goffi@necton2
parents:
diff changeset
217 status.append([contact]+contactStatus)
goffi@necton2
parents:
diff changeset
218 debug ("Memory getPresenceStatus (%s)", status)
goffi@necton2
parents:
diff changeset
219 return status
goffi@necton2
parents:
diff changeset
220
17
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
221 def getParamV(self, name, category):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
222 return self.params.getParamV(name, category)
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
223
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
224 def getParams(self):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
225 return self.params.getParams()
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
226
0
goffi@necton2
parents:
diff changeset
227 def getParamsCategories(self):
17
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
228 return self.params.getParamsCategories()
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
229
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
230 def setParam(self, name, value, category):
74a39f40eb6d refactoring: using xml params (not finished yet)
Goffi <goffi@goffi.org>
parents: 14
diff changeset
231 return self.params.setParam(name, value, category)