@@ -22,11 +22,11 def prettify(elem): | |||
|
22 | 22 | # id = 1 |
|
23 | 23 | # x = self.data.projectWindow.cmbbox.value() |
|
24 | 24 | # |
|
25 |
# projectObj = |
|
|
25 | # projectObj = Controller(id, name, description) | |
|
26 | 26 | # |
|
27 | 27 | # projectObj.setup(id, name, description) |
|
28 | 28 | |
|
29 |
class |
|
|
29 | class Controller(): | |
|
30 | 30 | |
|
31 | 31 | id = None |
|
32 | 32 | name = None |
@@ -71,7 +71,7 class Project(): | |||
|
71 | 71 | |
|
72 | 72 | def makeXml(self): |
|
73 | 73 | |
|
74 |
projectElement = Element(' |
|
|
74 | projectElement = Element('Controller') | |
|
75 | 75 | projectElement.set('id', str(self.id)) |
|
76 | 76 | projectElement.set('name', self.name) |
|
77 | 77 | #projectElement.set('description', self.description) |
@@ -125,22 +125,6 class Project(): | |||
|
125 | 125 | name = readBranch.get('name') |
|
126 | 126 | self.idpb=id |
|
127 | 127 | self.nameBranch=name |
|
128 | # | |
|
129 | ####ESTO DEL MEDIO ESTABA COMENTADO | |
|
130 | # print root.tag , root.attrib | |
|
131 | # | |
|
132 | # print root.attrib.get('id') | |
|
133 | # print root.attrib.get('name') | |
|
134 | ||
|
135 | ||
|
136 | # for description in root.findall('description'): | |
|
137 | # description = root.find('description').text | |
|
138 | # name = root.get('name') | |
|
139 | # print name, description | |
|
140 | ||
|
141 | # description=root.find('description').text | |
|
142 | # print description | |
|
143 | # ESTO FUNCIONABA HACIA ABAJO | |
|
144 | 128 | |
|
145 | 129 | root=tree.getroot() |
|
146 | 130 | print root.tag , root.attrib |
@@ -180,36 +164,6 class ReadBranch(): | |||
|
180 | 164 | readBranchElement = SubElement(projectElement, 'readBranch') |
|
181 | 165 | readBranchElement.set('id', str(self.id)) |
|
182 | 166 | |
|
183 | # readBranchElement.set('dpath', self.dpath) | |
|
184 | # readBranchElement.set('dataformat', self.dataformat) | |
|
185 | # readBranchElement.set('startDate', self.startDate) | |
|
186 | # readBranchElement.set('endDate', self.endDate) | |
|
187 | # readBranchElement.set('startTime', self.startTime) | |
|
188 | # readBranchElement.set('endTime', self.endTime) | |
|
189 | # readBranchElement.set('readMode', str(self.readMode)) | |
|
190 | ||
|
191 | # se = SubElement(readBranchElement, 'dpath')#ESTO ES LO ULTIMO QUE SE TRABAJO | |
|
192 | # se.text = self.dpath | |
|
193 | # | |
|
194 | # se = SubElement(readBranchElement, 'dataformat')#ESTO ES LO ULTIMO QUE SE TRABAJO | |
|
195 | # se.text = self.dataformat | |
|
196 | # | |
|
197 | # se = SubElement(readBranchElement, 'startDate')#ESTO ES LO ULTIMO QUE SE TRABAJO | |
|
198 | # se.text = self.startDate | |
|
199 | # | |
|
200 | # se = SubElement(readBranchElement, 'endDate')#ESTO ES LO ULTIMO QUE SE TRABAJO | |
|
201 | # se.text = self.endDate | |
|
202 | # | |
|
203 | # se = SubElement(readBranchElement, 'startTime')#ESTO ES LO ULTIMO QUE SE TRABAJO | |
|
204 | # se.text = self.startTime | |
|
205 | # | |
|
206 | # se = SubElement(readBranchElement, 'endTime')#ESTO ES LO ULTIMO QUE SE TRABAJO | |
|
207 | # se.text = self.endTime | |
|
208 | # | |
|
209 | # se = SubElement(readBranchElement, 'readMode')#ESTO ES LO ULTIMO QUE SE TRABAJO | |
|
210 | # se.text = str(self.readMode) | |
|
211 | ||
|
212 | ########################################################################## | |
|
213 | 167 | se = SubElement(readBranchElement, 'parameter', name='dpath' , value=self.dpath) |
|
214 | 168 | se = SubElement(readBranchElement, 'parameter', name='dataformat', value=self.dataformat) |
|
215 | 169 | se = SubElement(readBranchElement, 'parameter', name='startDate' , value=self.startDate) |
@@ -237,7 +191,7 class ProcBranch(): | |||
|
237 | 191 | |
|
238 | 192 | id = len(self.upObjList) + 1 |
|
239 | 193 | |
|
240 | upObj = UP(id, name, type) | |
|
194 | upObj = UPConf(id, name, type) | |
|
241 | 195 | |
|
242 | 196 | self.upObjList.append(upObj) |
|
243 | 197 | |
@@ -252,7 +206,7 class ProcBranch(): | |||
|
252 | 206 | for upObj in self.upObjList: |
|
253 | 207 | upObj.makeXml(procBranchElement) |
|
254 | 208 | |
|
255 | class UP(): | |
|
209 | class UPConf(): | |
|
256 | 210 | |
|
257 | 211 | id = None |
|
258 | 212 | name = None |
@@ -272,7 +226,7 class UP(): | |||
|
272 | 226 | |
|
273 | 227 | id = len(self.opObjList) + 1 |
|
274 | 228 | |
|
275 | opObj = Operation(id, name, priority) | |
|
229 | opObj = OperationConf(id, name, priority) | |
|
276 | 230 | |
|
277 | 231 | self.opObjList.append(opObj) |
|
278 | 232 | |
@@ -288,7 +242,7 class UP(): | |||
|
288 | 242 | for opObj in self.opObjList: |
|
289 | 243 | opObj.makeXml(upElement) |
|
290 | 244 | |
|
291 | class Operation(): | |
|
245 | class OperationConf(): | |
|
292 | 246 | |
|
293 | 247 | id = 0 |
|
294 | 248 | name = None |
@@ -307,7 +261,7 class Operation(): | |||
|
307 | 261 | |
|
308 | 262 | id = len(self.parmObjList) + 1 |
|
309 | 263 | |
|
310 | parmObj = Parameter(id, name, value) | |
|
264 | parmObj = ParameterConf(id, name, value) | |
|
311 | 265 | |
|
312 | 266 | self.parmObjList.append(parmObj) |
|
313 | 267 | |
@@ -323,7 +277,7 class Operation(): | |||
|
323 | 277 | for parmObj in self.parmObjList: |
|
324 | 278 | parmObj.makeXml(opElement) |
|
325 | 279 | |
|
326 | class Parameter(): | |
|
280 | class ParameterConf(): | |
|
327 | 281 | |
|
328 | 282 | id = None |
|
329 | 283 | name = None |
@@ -353,7 +307,7 if __name__ == '__main__': | |||
|
353 | 307 | desc = "Este es un test" |
|
354 | 308 | filename = "test.xml" |
|
355 | 309 | |
|
356 |
projectObj = |
|
|
310 | projectObj = Controller() | |
|
357 | 311 | |
|
358 | 312 | projectObj.setParms(id = '11', name='test01', description=desc) |
|
359 | 313 |
General Comments 0
You need to be logged in to leave comments.
Login now