@@ -22,11 +22,11 def prettify(elem): | |||||
22 | # id = 1 |
|
22 | # id = 1 | |
23 | # x = self.data.projectWindow.cmbbox.value() |
|
23 | # x = self.data.projectWindow.cmbbox.value() | |
24 | # |
|
24 | # | |
25 |
# projectObj = |
|
25 | # projectObj = Controller(id, name, description) | |
26 | # |
|
26 | # | |
27 | # projectObj.setup(id, name, description) |
|
27 | # projectObj.setup(id, name, description) | |
28 |
|
28 | |||
29 |
class |
|
29 | class Controller(): | |
30 |
|
30 | |||
31 | id = None |
|
31 | id = None | |
32 | name = None |
|
32 | name = None | |
@@ -71,7 +71,7 class Project(): | |||||
71 |
|
71 | |||
72 | def makeXml(self): |
|
72 | def makeXml(self): | |
73 |
|
73 | |||
74 |
projectElement = Element(' |
|
74 | projectElement = Element('Controller') | |
75 | projectElement.set('id', str(self.id)) |
|
75 | projectElement.set('id', str(self.id)) | |
76 | projectElement.set('name', self.name) |
|
76 | projectElement.set('name', self.name) | |
77 | #projectElement.set('description', self.description) |
|
77 | #projectElement.set('description', self.description) | |
@@ -125,22 +125,6 class Project(): | |||||
125 | name = readBranch.get('name') |
|
125 | name = readBranch.get('name') | |
126 | self.idpb=id |
|
126 | self.idpb=id | |
127 | self.nameBranch=name |
|
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 | root=tree.getroot() |
|
129 | root=tree.getroot() | |
146 | print root.tag , root.attrib |
|
130 | print root.tag , root.attrib | |
@@ -180,36 +164,6 class ReadBranch(): | |||||
180 | readBranchElement = SubElement(projectElement, 'readBranch') |
|
164 | readBranchElement = SubElement(projectElement, 'readBranch') | |
181 | readBranchElement.set('id', str(self.id)) |
|
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 | se = SubElement(readBranchElement, 'parameter', name='dpath' , value=self.dpath) |
|
167 | se = SubElement(readBranchElement, 'parameter', name='dpath' , value=self.dpath) | |
214 | se = SubElement(readBranchElement, 'parameter', name='dataformat', value=self.dataformat) |
|
168 | se = SubElement(readBranchElement, 'parameter', name='dataformat', value=self.dataformat) | |
215 | se = SubElement(readBranchElement, 'parameter', name='startDate' , value=self.startDate) |
|
169 | se = SubElement(readBranchElement, 'parameter', name='startDate' , value=self.startDate) | |
@@ -237,7 +191,7 class ProcBranch(): | |||||
237 |
|
191 | |||
238 | id = len(self.upObjList) + 1 |
|
192 | id = len(self.upObjList) + 1 | |
239 |
|
193 | |||
240 | upObj = UP(id, name, type) |
|
194 | upObj = UPConf(id, name, type) | |
241 |
|
195 | |||
242 | self.upObjList.append(upObj) |
|
196 | self.upObjList.append(upObj) | |
243 |
|
197 | |||
@@ -252,7 +206,7 class ProcBranch(): | |||||
252 | for upObj in self.upObjList: |
|
206 | for upObj in self.upObjList: | |
253 | upObj.makeXml(procBranchElement) |
|
207 | upObj.makeXml(procBranchElement) | |
254 |
|
208 | |||
255 | class UP(): |
|
209 | class UPConf(): | |
256 |
|
210 | |||
257 | id = None |
|
211 | id = None | |
258 | name = None |
|
212 | name = None | |
@@ -272,7 +226,7 class UP(): | |||||
272 |
|
226 | |||
273 | id = len(self.opObjList) + 1 |
|
227 | id = len(self.opObjList) + 1 | |
274 |
|
228 | |||
275 | opObj = Operation(id, name, priority) |
|
229 | opObj = OperationConf(id, name, priority) | |
276 |
|
230 | |||
277 | self.opObjList.append(opObj) |
|
231 | self.opObjList.append(opObj) | |
278 |
|
232 | |||
@@ -288,7 +242,7 class UP(): | |||||
288 | for opObj in self.opObjList: |
|
242 | for opObj in self.opObjList: | |
289 | opObj.makeXml(upElement) |
|
243 | opObj.makeXml(upElement) | |
290 |
|
244 | |||
291 | class Operation(): |
|
245 | class OperationConf(): | |
292 |
|
246 | |||
293 | id = 0 |
|
247 | id = 0 | |
294 | name = None |
|
248 | name = None | |
@@ -307,7 +261,7 class Operation(): | |||||
307 |
|
261 | |||
308 | id = len(self.parmObjList) + 1 |
|
262 | id = len(self.parmObjList) + 1 | |
309 |
|
263 | |||
310 | parmObj = Parameter(id, name, value) |
|
264 | parmObj = ParameterConf(id, name, value) | |
311 |
|
265 | |||
312 | self.parmObjList.append(parmObj) |
|
266 | self.parmObjList.append(parmObj) | |
313 |
|
267 | |||
@@ -323,7 +277,7 class Operation(): | |||||
323 | for parmObj in self.parmObjList: |
|
277 | for parmObj in self.parmObjList: | |
324 | parmObj.makeXml(opElement) |
|
278 | parmObj.makeXml(opElement) | |
325 |
|
279 | |||
326 | class Parameter(): |
|
280 | class ParameterConf(): | |
327 |
|
281 | |||
328 | id = None |
|
282 | id = None | |
329 | name = None |
|
283 | name = None | |
@@ -353,7 +307,7 if __name__ == '__main__': | |||||
353 | desc = "Este es un test" |
|
307 | desc = "Este es un test" | |
354 | filename = "test.xml" |
|
308 | filename = "test.xml" | |
355 |
|
309 | |||
356 |
projectObj = |
|
310 | projectObj = Controller() | |
357 |
|
311 | |||
358 | projectObj.setParms(id = '11', name='test01', description=desc) |
|
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