class ParentAssigner(BaseAssigner): def __init__(self, parent, trait, suite, name='ParentAssigner'): self.app = get_application_pointer() self.conn = self.app.conn self.suite = suite self.trait = Trait(self.conn, suite=self.suite) self.trait.set_trait(trait) BaseAssigner.__init__(self, parent, name=name) self.connect(self, SIGNAL('okClicked()'), self.slotInsertNewParents) def initView(self): traits = self.trait.get_trait_list() traits.sort() parents = self.trait.parents() traits = [t for t in traits if t != self.trait.current_trait] abox = self.listBox.availableListBox() sbox = self.listBox.selectedListBox() avail_traits = [t for t in traits if t not in parents] for trait in avail_traits: r = QListBoxText(abox, trait) for trait in parents: r = QListBoxText(sbox, trait) def slotInsertNewParents(self): sbox = self.listBox.selectedListBox() parents = [str(sbox.item(n).text()) for n in range(sbox.numRows())] self.trait.update_parents(parents)
class ParentAssigner(BaseAssigner): def __init__(self, parent, trait, suite, name='ParentAssigner'): self.app = get_application_pointer() self.conn = self.app.conn self.suite = suite self.trait = Trait(self.conn, suite=self.suite) self.trait.set_trait(trait) BaseAssigner.__init__(self, parent, name=name) self.connect(self, SIGNAL('okClicked()'), self.slotInsertNewParents) def initView(self): traits = self.trait.get_trait_list() traits.sort() parents = self.trait.parents() traits = [t for t in traits if t != self.trait.current_trait] abox = self.listBox.availableListBox() sbox = self.listBox.selectedListBox() avail_traits = [t for t in traits if t not in parents] for trait in avail_traits: r = QListBoxText(abox, trait) for trait in parents: r = QListBoxText(sbox, trait) def slotInsertNewParents(self): sbox = self.listBox.selectedListBox() parents = [str(sbox.item(n).text()) for n in range(sbox.numRows())] self.trait.update_parents(parents)
class TemplateEditor(QSplitter): def __init__(self, app, parent, suite, name='TemplateEditor'): QSplitter.__init__(self, parent, name) dbwidget(self, app) self.trait = None self.listView = TraitList(self.app, self, 'template') self.mainEdit = SimpleEdit(self.app, self) self.set_suite(suite) self.refreshListView() self.connect(self.listView, SIGNAL('selectionChanged()'), self.selectionChanged) def set_suite(self, suite): self.suite = suite self.listView.set_suite(suite) self.trait = Trait(self.conn, suite=suite) def set_trait(self, trait): self.trait.set_trait(trait) def refreshListView(self): self.listView.refreshlistView() def selectionChanged(self): current = self.listView.currentItem() if hasattr(current, 'row'): self.mainEdit.setText(self.listView.getData())
class ToolkitDatabase(object): def __init__(self, conn): self.conn = conn self.profile = Profile(self.conn) self.family = Family(self.conn) self.suite = None self.trait = None self.machine = MachineHandler(self.conn) def set_profile(self, profile): self.profile.set_profile(profile) self.suite = self.profile.current.suite self.trait = Trait(self.conn, self.suite) def set_trait(self, trait): self.trait.set_trait(trait) def set_machine(self, machine): self.machine.set_machine(machine) profile = self.machine.get_profile() self.set_profile(profile) if os.environ.has_key('PAELLA_TRAIT'): self.set_trait(os.environ['PAELLA_TRAIT']) def env(self): env = TemplatedEnvironment() if self.trait.current_trait is not None: env.update(self.trait._parents.Environment()) env.update(self.profile.get_family_data()) env.update(self.profile.get_profile_data()) if self.machine.current_machine is not None: env.update(self.machine.get_machine_data()) return env
class TraitDescriptionWindow(BaseTextEditWindow): def __init__(self, parent, trait, suite, name='TraitDescriptionWindow'): BaseTextEditWindow.__init__(self, parent, KTextEdit, name=name) self.initPaellaCommon() self.trait = Trait(self.conn, suite=suite) self.trait.set_trait(trait) self.resize(600, 800) desc = self.trait.get_description() if desc is not None: self.mainView.setText(desc) def _status_msg(self, status=None): msg = 'Description of trait %s' % self.trait.current_trait if status is None: return msg else: return '%s %s' % (status, msg) def slotSave(self): text = str(self.mainView.text()) oldtext = self.trait.get_description() if oldtext is None: oldtext = '' if oldtext != text: self.trait.set_description(text) self._update_status('Saved') else: KMessageBox.information(self, 'Nothing has changed') self._update_status()
class TemplateEditor(QSplitter): def __init__(self, parent, suite, name='TemplateEditor'): QSplitter.__init__(self, parent, name) self.app = get_application_pointer() self.trait = None self.listView = TraitListView(self, 'template') self.mainEdit = SimpleEdit(self) self.set_suite(suite) self.refreshListView() self.connect(self.listView, SIGNAL('selectionChanged()'), self.selectionChanged) def set_suite(self, suite): self.suite = suite self.listView.set_suite(suite) self.trait = Trait(self.conn, suite=suite) def set_trait(self, trait): self.trait.set_trait(trait) def refreshListView(self): self.listView.refreshlistView() def selectionChanged(self): current = self.listView.currentItem() if hasattr(current, 'row'): self.mainEdit.setText(self.listView.getData())
class TraitDescriptionWindow(BaseTextEditWindow): def __init__(self, parent, trait, suite, name='TraitDescriptionWindow'): BaseTextEditWindow.__init__(self, parent, KTextEdit, name=name) self.initPaellaCommon() self.trait = Trait(self.conn, suite=suite) self.trait.set_trait(trait) self.resize(600, 800) desc = self.trait.get_description() if desc is not None: self.mainView.setText(desc) def _status_msg(self, status=None): msg = 'Description of trait %s' % self.trait.current_trait if status is None: return msg else: return '%s %s' % (status, msg) def slotSave(self): text = str(self.mainView.text()) oldtext = self.trait.get_description() if oldtext is None: oldtext = '' if oldtext != text: self.trait.set_description(text) self._update_status('Saved') else: KMessageBox.information(self, 'Nothing has changed') self._update_status()
class TraitDoc(BaseDocument): def __init__(self, app, **atts): BaseDocument.__init__(self, app, **atts) self.trait = Trait(self.conn) def set_trait(self, trait): self.clear_body() self.trait.set_trait(trait) title = SimpleTitleElement('Trait: %s' % trait, bgcolor='IndianRed', width='100%') self.body.appendChild(title) self.body.appendChild(HR()) plist = UnorderedList() parents = self.trait.parents(trait=trait) parent_section = SectionTitle('Parents') parent_section.create_rightside_table() parent_section.append_rightside_anchor( Anchor('hello.there.dude', 'edit')) parent_section.append_rightside_anchor( Anchor('hello.there.dudee', 'edit2')) self.body.appendChild(parent_section) for parent in parents: pp = Anchor('show.parent.%s' % parent, parent) plist.appendChild(ListItem(pp)) self.body.appendChild(plist) #ptitle_anchor = Anchor('edit.packages.%s' % trait, 'Packages') ptitle = SectionTitle('Packages') ptitle_anchor = Anchor('new.package.%s' % trait, '(new)') td = TD() td.appendChild(ptitle_anchor) ptitle.row.appendChild(td) self.body.appendChild(ptitle) rows = self.trait.packages(trait=trait, action=True) self.body.appendChild(PackageTable(rows, bgcolor='SkyBlue3')) ttitle = Anchor('edit.templates.%s' % trait, 'Templates') self.body.appendChild(SectionTitle(ttitle)) rows = self.trait.templates( trait=trait, fields=['package', 'template', 'templatefile']) if len(rows): self.body.appendChild(TemplateTable(rows, bgcolor='DarkSeaGreen3')) self.body.appendChild(SectionTitle('Variables', href='foo.var.ick')) if len(self.trait.environ.keys()): env = TraitEnvTable(trait, self.trait.environ, bgcolor='MistyRose3') self.body.appendChild(env) self.body.appendChild(SectionTitle('Scripts')) slist = UnorderedList() for row in self.trait._scripts.scripts(trait=trait): script = row.script sa = Anchor('show.script.%s' % script, script) slist.appendChild(ListItem(sa)) self.body.appendChild(slist)
class TraitDoc(BaseDocument): def __init__(self, app, **atts): BaseDocument.__init__(self, app, **atts) self.trait = Trait(self.conn) def set_trait(self, trait): self.clear_body() self.trait.set_trait(trait) title = SimpleTitleElement('Trait: %s' % trait, bgcolor='IndianRed', width='100%') self.body.appendChild(title) self.body.appendChild(HR()) plist = UnorderedList() parents = self.trait.parents(trait=trait) parent_section = SectionTitle('Parents') parent_section.create_rightside_table() parent_section.append_rightside_anchor(Anchor('hello.there.dude', 'edit')) parent_section.append_rightside_anchor(Anchor('hello.there.dudee', 'edit2')) self.body.appendChild(parent_section) for parent in parents: pp = Anchor('show.parent.%s' % parent, parent) plist.appendChild(ListItem(pp)) self.body.appendChild(plist) #ptitle_anchor = Anchor('edit.packages.%s' % trait, 'Packages') ptitle = SectionTitle('Packages') ptitle_anchor = Anchor('new.package.%s' % trait, '(new)') td = TD() td.appendChild(ptitle_anchor) ptitle.row.appendChild(td) self.body.appendChild(ptitle) rows = self.trait.packages(trait=trait, action=True) self.body.appendChild(PackageTable(rows, bgcolor='SkyBlue3')) ttitle = Anchor('edit.templates.%s' % trait, 'Templates') self.body.appendChild(SectionTitle(ttitle)) rows = self.trait.templates(trait=trait, fields=['package', 'template', 'templatefile']) if len(rows): self.body.appendChild(TemplateTable(rows, bgcolor='DarkSeaGreen3')) self.body.appendChild(SectionTitle('Variables', href='foo.var.ick')) if len(self.trait.environ.keys()): env = TraitEnvTable(trait, self.trait.environ, bgcolor='MistyRose3') self.body.appendChild(env) self.body.appendChild(SectionTitle('Scripts')) slist = UnorderedList() for row in self.trait._scripts.scripts(trait=trait): script = row.script p = Paragraph() sa = Anchor('show.script.%s' % script, script) ea = Anchor('edit.script.%s' % script, ' (edit)') p.appendChild(sa) p.appendChild(ea) slist.appendChild(ListItem(p)) self.body.appendChild(slist)
class PaellaFile(object): def __init__(self, conn, fspath, flags, *mode): logging.info('PaellaFile.__init__ start') self.conn = conn self.fileobj = None self.info = pathinfo(fspath) #logging.info('info %s' % self.info) #logging.info('conn %s' % self.conn) self.fspath = fspath self.traitdb = Trait(self.conn, self.info['suite']) #logging.info('traitdb %s' % self.traitdb) #logging.info('set trait to %s' % self.info['trait']) self.traitdb.set_trait(self.info['trait']) logging.info('traitdb.current_trait %s' % self.traitdb.current_trait) #logging.info('PaellaFile.__init__ info: %s' % self.info) fname = self.info['fname'] ftype = self.info['ftype'] if ftype == 'scripts': self. fileobj = self.traitdb._scripts.scriptfile(fname) else: logging.warn('Unable to handle ftype of %s' % ftype) logging.info('PaellaFile initialized with %s, %s' % (ftype, fname)) def read(self, length, offset): logging.info('PaellaFile.read(%d, %d)' % (length, offset)) self.fileobj.seek(offset) data = self.fileobj.read(length) #logging.info('read data %s' % data) return data def fgetattr(self): logging.info('PaellaFile.fgetattr called') st = MyStat() st.st_mode = stat.S_IFREG | 0644 st.st_uid = os.getuid() st.st_gid = os.getgid() st.st_size = self.fileobj.len return st def release(self, flags): self.fileobj.close() def test__getattr__(self, attribute, *args, **kw): if hasattr(self, attribute): return getattr(self, attribute, *args, **kw) else: logging.warn('%s called in PaellaFile' % attribute) raise AttributeError , "PaellaFile instance has no attribute '%s'" % attribute
class TraitDoc(BaseDocument): def __init__(self, app, **atts): BaseDocument.__init__(self, app, **atts) self.trait = Trait(self.conn) def set_trait(self, trait): self.clear_body() self.trait.set_trait(trait) title = SimpleTitleElement("Trait: %s" % trait, bgcolor="IndianRed", width="100%") self.body.appendChild(title) self.body.appendChild(HR()) plist = UnorderedList() parents = self.trait.parents(trait=trait) parent_section = SectionTitle("Parents") parent_section.create_rightside_table() parent_section.append_rightside_anchor(Anchor("hello.there.dude", "edit")) parent_section.append_rightside_anchor(Anchor("hello.there.dudee", "edit2")) self.body.appendChild(parent_section) for parent in parents: pp = Anchor("show.parent.%s" % parent, parent) plist.appendChild(ListItem(pp)) self.body.appendChild(plist) # ptitle_anchor = Anchor('edit.packages.%s' % trait, 'Packages') ptitle = SectionTitle("Packages") ptitle_anchor = Anchor("new.package.%s" % trait, "(new)") td = TD() td.appendChild(ptitle_anchor) ptitle.row.appendChild(td) self.body.appendChild(ptitle) rows = self.trait.packages(trait=trait, action=True) self.body.appendChild(PackageTable(rows, bgcolor="SkyBlue3")) ttitle = Anchor("edit.templates.%s" % trait, "Templates") self.body.appendChild(SectionTitle(ttitle)) rows = self.trait.templates(trait=trait, fields=["package", "template", "templatefile"]) if len(rows): self.body.appendChild(TemplateTable(rows, bgcolor="DarkSeaGreen3")) self.body.appendChild(SectionTitle("Variables", href="foo.var.ick")) if len(self.trait.environ.keys()): env = TraitEnvTable(trait, self.trait.environ, bgcolor="MistyRose3") self.body.appendChild(env) self.body.appendChild(SectionTitle("Scripts")) slist = UnorderedList() for row in self.trait._scripts.scripts(trait=trait): script = row.script sa = Anchor("show.script.%s" % script, script) slist.appendChild(ListItem(sa)) self.body.appendChild(slist)
def readdir(self, fspath, offset): dirents = ['.', '..'] if fspath == '/': dirents.extend(self.db.suitecursor.get_suites()) else: logging.warn("Need to handle %s" % fspath) depth = fspath.count('/') logging.warn('depth is %d' % depth) if depth == 1: suite = os.path.basename(fspath) logging.info('fspath is %s' % fspath) logging.info('suite is %s' % suite) traitdb = Trait(self.conn, suite) traits = traitdb.get_trait_list() dirents.extend(traits) elif depth == 2: trait = os.path.basename(fspath) dirname = os.path.dirname(fspath) suite = os.path.basename(dirname) logging.info('depth 2, suite %s, trait %s' % (suite, trait)) dirents.extend(['scripts', 'templates']) elif depth == 3: ignore, suite, trait, ftype = fspath.split('/') logging.info('ftype is %s' % ftype) logging.info('suite is %s' % suite) logging.info('trait is %s' % trait) traitdb = Trait(self.conn, suite) traitdb.set_trait(trait) if ftype == 'scripts': scripts = traitdb._scripts.scripts(trait=trait) scripts = [row.script for row in scripts] dirents.extend(scripts) else: logging.warn('unable to handle ftype %s' % ftype) else: logging.warn('unable to handle depth of %d' % depth) for ent in dirents: yield fuse.Direntry(ent)
class InstallerTools(object): def __init__(self): object.__init__(self) self.cfg = PaellaConfig() self.conn = InstallerConnection() self.profile = os.environ["PAELLA_PROFILE"] self.target = path(os.environ["PAELLA_TARGET"]) self.machine = None self.trait = None self.suite = get_suite(self.conn, self.profile) self.pr = Profile(self.conn) self.pr.set_profile(self.profile) self.traitlist = self.pr.make_traitlist() self.pe = ProfileEnvironment(self.conn, self.profile) self.tp = TraitParent(self.conn, self.suite) self.fm = Family(self.conn) self.tr = Trait(self.conn, self.suite) self.families = list(self.fm.get_related_families(self.pr.get_families())) self._envv = None self.default = DefaultEnvironment(self.conn) # self.installer = TraitInstaller(self.conn, self.suite) self.installer = ProfileInstaller(self.conn) self.installer.set_logfile() self.installer.set_profile(self.profile) self.installer.set_target(self.target) if os.environ.has_key("PAELLA_MACHINE"): self.machine = os.environ["PAELLA_MACHINE"] if os.environ.has_key("PAELLA_TRAIT"): self.set_trait(os.environ["PAELLA_TRAIT"]) # this needs updating for machine type data def env(self): env = TemplatedEnvironment(self.tp.Environment()) env.update(self.pr.get_family_data()) env.update(self.pr.get_profile_data()) return env def set_trait(self, trait): self.trait = trait self.tp.set_trait(trait) self.tr.set_trait(trait) self.parents = self.tr.parents() self._envv = self.env() tinstaller = self.installer.installer tinstaller.set_trait(trait) self.packages = tinstaller.traitpackage.packages() self.templates = tinstaller.traittemplate.templates() def get(self, key): if self._envv is None: raise Error, "need to set trait first" return self._envv.dereference(key) def lget(self, key): key = "_".join([self.trait, key]) return self.get(key) def install_modules(self, name): modules = str2list(self.get(name)) print "installing modules", modules, "to %s/etc/modules" % self.target setup_modules(self.target, modules) def remove_packages(self, packages=None): if packages is None: packages = self.packages if len(packages): if hasattr(packages[0], "package"): packages = [p.package for p in packages] package_list = " ".join(packages) command = "apt-get -y remove %s" % package_list self.installer.run("remove", command, proc=True) def chroot_command(self, cmd): return "chroot %s %s" % (self.target, cmd)
class InstallerTools(object): def __init__(self): object.__init__(self) self.cfg = PaellaConfig() self.conn = PaellaConnection() self.profile = os.environ['PAELLA_PROFILE'] self.target = os.environ['PAELLA_TARGET'] self.machine = None self.trait = None self.suite = get_suite(self.conn, self.profile) self.pr = Profile(self.conn) self.pr.set_profile(self.profile) self.traitlist = self.pr.make_traitlist() self.pe = ProfileEnvironment(self.conn, self.profile) self.tp = TraitParent(self.conn, self.suite) self.fm = Family(self.conn) self.tr = Trait(self.conn, self.suite) self.families = list(self.fm.get_related_families(self.pr.get_families())) self._envv = None self.default = DefaultEnvironment(self.conn) self.installer = TraitInstaller(self.conn, self.suite, self.cfg) if os.environ.has_key('PAELLA_MACHINE'): self.machine = os.environ['PAELLA_MACHINE'] if os.environ.has_key('PAELLA_TRAIT'): self.set_trait(os.environ['PAELLA_TRAIT']) def env(self): env = RefDict(self.tp.Environment()) env.update(self.pr.get_family_data()) env.update(self.pr.get_profile_data()) return env def set_trait(self, trait): self.trait = trait self.tp.set_trait(trait) self.tr.set_trait(trait) self.parents = self.tr.parents() self._envv = self.env() self.installer.set_trait(trait) self.packages = self.installer.traitpackage.packages() self.templates = self.installer.traittemplate.templates() def get(self, key): if self._envv is None: raise Error, 'need to set trait first' return self._envv.dereference(key) def install_modules(self, name): modules = str2list(self.get(name)) print 'installing modules', modules, 'to %s/etc/modules' % self.target setup_modules(self.target, modules) def remove_packages(self, packages=None): if packages is None: packages = self.packages if len(packages): if hasattr(packages[0], 'package'): packages = [p.package for p in packages] package_list = ' '.join(packages) command = 'apt-get -y remove %s' % package_list self.installer.run('remove', command, proc=True)
class TraitBrowser(ListNoteBook): def __init__(self, conn, suite): self.menu = make_menu(['delete'], self.modify_trait) ListNoteBook.__init__(self) self.conn = conn self.suite = suite self.trait = Trait(self.conn, self.suite) self.package_menu = make_menu(['install', 'remove', 'purge', 'drop'], self.set_package) self.parent_menu = make_menu(['drop'], self.modify_parent) self.reset_rows() self.append_page(ScrollCList(rcmenu=self.package_menu), 'packages') self.append_page(ScrollCList(rcmenu=self.parent_menu), 'parents') self.set_size_request(400, 300) def modify_parent(self, menuitem, action): if action == 'drop': parents = self._get_listbox_col_('parents', 'trait') self.trait.delete_parents(parents) self.__set_pages(self.current_trait) def modify_trait(self, menuitem, action): if action == 'delete': trait = self.listbox.get_selected_data()[0].trait self.trait.delete_trait(trait) self.reset_rows() def reset_rows(self): self.set_rows(self.trait.get_traits()) self.set_row_select(self.trait_selected) def __set_droptargets__(self, pages): set_receive_targets(pages['packages'].listbox, self.drop_package, TARGETS.get('package', self.suite)) set_receive_targets(pages['parents'].listbox, self.drop_trait, TARGETS.get('trait', self.suite)) def set_package(self, menu_item, action): packages = self._get_listbox_col_('packages', 'package') trait = self.current_trait self.trait.set_action(action, packages) self.__set_pages(self.current_trait) def pop_mymenu(self, widget, event, menu): if right_click_pressed(event): menu.popup(None, None, None, event.button, event.time) def trait_selected(self, listbox, row, column, event): trait = listbox.get_selected_data()[0].trait self.select_trait(trait) def select_trait(self, trait): self.current_trait = trait self.trait.set_trait(trait) self.__set_pages(self.current_trait) def __set_pages(self, trait): pages = dict(self.pages) pages['packages'].set_rows(self.trait.packages(action=True)) pages['packages'].set_select_mode('multi') pages['parents'].set_rows(self.trait.parents(), ['trait']) pages['parents'].set_select_mode('multi') self.__set_droptargets__(pages) def drop_package(self, listbox, context, x, y, selection, targettype, time): packages = Set(selection.data.split('^&^')) self.trait.insert_packages(packages) self.__set_pages(self.current_trait) def drop_trait(self, listbox, context, x, y, selection, targettype, time): traits = selection.data.split('^&^') self.trait.insert_parents(traits) self.__set_pages(self.current_trait) def _get_listbox_col_(self, page, field): pages = dict(self.pages) return [row[field] for row in pages[page].listbox.get_selected_data()] def change_suite(self, suite): self.suite = suite self.trait = Trait(self.conn, self.suite) self.reset_rows()
class TraitBrowser(ListNoteBook): def __init__(self, conn, suite): self.menu = make_menu(['delete'], self.modify_trait) ListNoteBook.__init__(self) self.conn = conn self.suite = suite self.trait = Trait(self.conn, self.suite) self.package_menu = make_menu(['install', 'remove', 'purge', 'drop'], self.set_package) self.parent_menu = make_menu(['drop'], self.modify_parent) self.reset_rows() self.append_page(ScrollCList(rcmenu=self.package_menu), 'packages') self.append_page(ScrollCList(rcmenu=self.parent_menu), 'parents') self.set_size_request(400, 300) def modify_parent(self, menuitem, action): if action == 'drop': parents = self._get_listbox_col_('parents', 'trait') self.trait.delete_parents(parents) self.__set_pages(self.current_trait) def modify_trait(self, menuitem, action): if action == 'delete': trait = self.listbox.get_selected_data()[0].trait self.trait.delete_trait(trait) self.reset_rows() def reset_rows(self): self.set_rows(self.trait.get_traits()) self.set_row_select(self.trait_selected) def __set_droptargets__(self, pages): set_receive_targets(pages['packages'].listbox, self.drop_package, TARGETS.get('package', self.suite)) set_receive_targets(pages['parents'].listbox, self.drop_trait, TARGETS.get('trait', self.suite)) def set_package(self, menu_item, action): packages = self._get_listbox_col_('packages', 'package') trait = self.current_trait self.trait.set_action(action, packages) self.__set_pages(self.current_trait) def pop_mymenu(self, widget, event, menu): if right_click_pressed(event): menu.popup(None, None, None, event.button, event.time) def trait_selected(self, listbox, row, column, event): trait = listbox.get_selected_data()[0].trait self.select_trait(trait) def select_trait(self, trait): self.current_trait = trait self.trait.set_trait(trait) self.__set_pages(self.current_trait) def __set_pages(self, trait): pages = dict(self.pages) pages['packages'].set_rows(self.trait.packages(action=True)) pages['packages'].set_select_mode('multi') pages['parents'].set_rows(self.trait.parents(), ['trait']) pages['parents'].set_select_mode('multi') self.__set_droptargets__(pages) def drop_package(self, listbox, context, x, y, selection, targettype, time): packages = Set(selection.data.split('^&^')) self.trait.insert_packages(packages) self.__set_pages(self.current_trait) def drop_trait(self, listbox, context, x, y, selection, targettype, time): traits = selection.data.split('^&^') self.trait.insert_parents(traits) self.__set_pages(self.current_trait) def _get_listbox_col_(self, page, field): pages = dict(self.pages) return [row[field] for row in pages[page].listbox.get_selected_data()] def change_suite(self, suite): self.suite = suite self.trait = Trait(self.conn, self.suite) self.reset_rows()