Changeset 1229
- Timestamp:
- 08/03/07 13:52:25 (6 years ago)
- Files:
-
- 1 modified
-
branch/k0p/umitInterfaceEditor/ProfileCore.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branch/k0p/umitInterfaceEditor/ProfileCore.py
r1166 r1229 170 170 result.append(tmp_po) 171 171 return result 172 173 172 174 173 175 174 def add_section(self): 176 175 pass 176 def remove_opt(self, section, name): 177 178 179 elem = self.search_option(section, name) 180 root = self.xml_parse.getElementsByTagName(self.root_tag)[0] 181 sec = root.getElementsByTagName(section) 182 183 sec[0].removeChild(elem) 177 184 def remove_section(self, section_name): 178 185 ''' … … 187 194 elem = self.search_in_groups(name) 188 195 root.removeChild(elem) 196 197 189 198 190 199 def search_in_groups(self, name): … … 248 257 return result 249 258 250 259 def add_option_before(self, section_name, option, before): 260 261 result = self.xml.getElementsByTagName(section_name)[0].insertBefore(option, before) 251 262 252 263 def add_option(self, section_name, tagname, label, option=None, … … 296 307 result.appendChild(i) 297 308 298 309 def get_prev(self, section): 310 ''' 311 get prev section 312 ''' 313 314 element = self.xml.getElementsByTagName('groups')[0] 315 element_group = element.getElementsByTagName(u'group') 316 result = None 317 for i in element_group: 318 if i.getAttribute('name') == name: 319 break 320 321 result = i 322 return result 323 324 325 326 327 def move_section_left(self, section): 328 none_prev = self.get_prev(section) 329 330 def move_section_right(self, section): 331 pass 332 def get_list_opt(self, section): 333 pass 334 def get_prev_opt(section, option): 335 elem = self.search_option(section, option) 336 pass 337 338 def move_option_up(self, section,option, option_up): 339 option_prev = self.search_option(section, option_up) 340 if option_up == None : 341 pass 342 else: 343 elem = self.search_option(section, option) 344 self.remove_opt(section, option) 345 self.add_option_before(section, elem, option_prev) 346 347 348 349 def move_option_down(self, section, option, option_down): 350 option_next = self.search_option(section, option_down) 351 if option_down == None : 352 pass 353 else: 354 self.remove_opt(section, option_down) 355 elem = self.search_option(section, option) 356 self.add_option_before(section, option_next, elem) 357 358 299 359 300 360 … … 329 389 #s.add_option('Scan', 'option_list', 'dasdas', 'dasda', 330 390 # 'dasdas', ['sdas','dasda'], 'Timing: ') 391 s.remove_opt('Scan', 'TCP scan: ') 331 392 s.print_screen() 332 393
