예제 #1
0
 def family_command(self, menuitem, action):
     print action
     families = [x[0] for x in self.pages['families'].get_selected_data()]
     if action == 'drop':
         clause = Eq('profile', self.current.profile) & In(
             'family', families)
         self.pfamily.delete(clause=clause)
예제 #2
0
 def __init__(self, conn, machines=None):
     Element.__init__(self, 'machines')
     self.conn = conn
     self.cursor = StatementCursor(self.conn)
     self.machines = []
     if machines is None:
         machines = self.cursor.select(table='machines', order='machine')
     else:
         clause = In('machine', machines)
         machines = self.cursor.select(table='machines',
                                       clause=clause,
                                       order='machine')
     for m in machines:
         machine_element = MachineElement(m.machine, m.machine_type,
                                          m.kernel, m.profile, m.filesystem)
         self.machines.append(machine_element)
         self.appendChild(machine_element)