def __init__(self, name='TraitBar'): HBox.__init__(self) self.set_name(name) self.lcombo = MyCombo() self.rcombo = MyCombo() self.lcombo.set('') self.rcombo.set('') self.cbutton = Button('clear') self.cbutton.show() self.pack_start(self.lcombo, 0, 0, 0) self.pack_end(self.rcombo, 0, 0, 0) self.add(self.cbutton) self.show()
def __init__(self, conn, suite, name='PackagesWindow'): self.cmd = StatementCursor(conn, name=name) table = ujoin(suite, 'packages') self.cmd.set_table(table) section_query ='select distinct section from %s' % table sections = [x.section for x in self.cmd.get(section_query)] self.section_combo = MyCombo(sections) self.section_combo.set(sections[0]) rows = self.cmd.select(clause="section = '%s'" % sections[0]) packer = lambda x : rowpacker('package', x) DragListWindow.__init__(self, '%s packages' % suite, packer, rows, TARGETS.get('package', suite), name=name) self.vbox.pack_start(self.section_combo,0,0,0) self.set_size_request(400, 300) self.set_ok(self.set_packages)
def __init__(self, suites, name='SuiteBar'): HBox.__init__(self) self.set_name(name) self.lcombo = MyCombo(suites) self.lcombo.set(suites[0]) self.rcombo = MyCombo(suites) self.rcombo.set(suites[0]) self.ubutton = Button('update') self.dbutton = Button('diff') self.pack_start(self.lcombo, 0, 0, 0) self.pack_end(self.rcombo, 0, 0, 0) self.add(self.ubutton) self.add(self.dbutton) self.ubutton.show() self.dbutton.show() self.show()
class PackagesWindow(DragListWindow): def __init__(self, conn, suite, name='PackagesWindow'): self.cmd = StatementCursor(conn, name=name) table = ujoin(suite, 'packages') self.cmd.set_table(table) section_query ='select distinct section from %s' % table sections = [x.section for x in self.cmd.get(section_query)] self.section_combo = MyCombo(sections) self.section_combo.set(sections[0]) rows = self.cmd.select(clause="section = '%s'" % sections[0]) packer = lambda x : rowpacker('package', x) DragListWindow.__init__(self, '%s packages' % suite, packer, rows, TARGETS.get('package', suite), name=name) self.vbox.pack_start(self.section_combo,0,0,0) self.set_size_request(400, 300) self.set_ok(self.set_packages) def set_packages(self, *args): section = self.section_combo.get() fields = ['package', 'priority', 'version', 'installedsize', 'maintainer', 'size'] rows = self.cmd.select(fields=fields, clause=Eq('section', section)) self.set_rows(rows) self.set_select_mode('multi')