def page2_add(self, *args): description = Types.EntryDescription('NEW') iter = self.em.append(('NEW', description, 'new')) if iter: s_iter = self.sem.convert_child_iter_to_iter(None, iter) s_path = self.sem.get_path(s_iter) self.entries2.scroll_to_cell(s_path) self.s2.select_iter(s_iter) self.entries[self.em[iter][2]] = self.em[iter][1] self.check()
def _set_entries(entries): desc = Config.get('base/fields').data ent = {} for e in entries.keys(): d = Types.EntryDescription(e) d.mandatory = \ map (lambda x, desc=desc: desc [x], entries [e] [0]) d.optional = \ map (lambda x, desc=desc: desc [x], entries [e] [1]) ent[string.lower(e)] = d Config.set('base/entries', ent) return