Esempio n. 1
0
 def __set_suite_cursors__(self, suite):
     self.traits = StatementCursor(self.conn, 'traits')
     self.traits.set_table(ujoin(suite, 'traits'))
     self.traitparent = TraitParent(self.conn, suite)
     self.traitpackage = TraitPackage(self.conn, suite)
     self.traittemplate = TraitTemplate(self.conn, suite)
     self.traitdebconf = TraitDebconf(self.conn, suite)
 def __init__(self, suite, traits_table, packages_table):
     tablename = ujoin(suite, 'templates')
     packs_column = PkBigname('package')
     packs_column.set_fk(packages_table)
     tcolumns = template_columns()
     columns = tcolumns[:1] + [packs_column] + tcolumns[1:]
     _TraitRelation.__init__(self, traits_table, tablename, columns)
Esempio n. 3
0
 def __init__(self, suite, traits_table):
     tablename = ujoin(suite, 'scripts')
     script_column = PkName('script')
     script_column.set_fk('scriptnames')
     sfile_column = Oid('scriptfile')
     script_columns = [script_column, sfile_column]
     _TraitRelation.__init__(self, traits_table, tablename, script_columns)
Esempio n. 4
0
 def create_entry(self, *args):
     var = dict(self.editor.dialogs['create'].items())
     debug('var is %s' % var)
     self.environ[self.trait][var['name']] = var['value']
     tagname = ujoin(self.trait, var['name'])
     self.editor.make_tag(tagname)
     self.editor.destroy_dialog(self.editor.dialogs['create'])
Esempio n. 5
0
 def __init__(self, conn, suite):
     table = ujoin(suite, 'templates')
     _TraitRelation.__init__(self, conn, suite, table, name='TraitTemplate')
     self.traitparent = TraitParent(conn, suite)
     self.template = Template()
     self.template.set_suite(suite)
     self.template_path = None
Esempio n. 6
0
 def __set_suite_cursors__(self, suite):
     self.traits = StatementCursor(self.conn, 'traits')
     self.traits.set_table(ujoin(suite, 'traits'))
     self.traitparent = TraitParent(self.conn, suite)
     self.traitpackage = TraitPackage(self.conn, suite)
     self.traittemplate = TraitTemplate(self.conn, suite)
     self.traitdebconf = TraitDebconf(self.conn, suite)
 def __init__(self, suite, traits_table):
     tablename = ujoin(suite, 'scripts')
     script_column = PkName('script')
     script_column.set_fk('scriptnames')
     sfile_column = Oid('scriptfile')
     script_columns = [script_column, sfile_column]
     _TraitRelation.__init__(self, traits_table, tablename, script_columns)
Esempio n. 8
0
 def __init__(self, conn, suite):
     table = ujoin(suite, 'templates')
     _TraitRelation.__init__(self, conn, suite, table, name='TraitTemplate')
     self.traitparent = TraitParent(conn, suite)
     self.template = Template()
     self.template.set_suite(suite)
     self.template_path = None
Esempio n. 9
0
 def __init__(self, suite, traits_table, packages_table):
     tablename = ujoin(suite, 'templates')
     packs_column = PkBigname('package')
     packs_column.set_fk(packages_table)
     tcolumns = template_columns()
     columns = tcolumns[:1] + [packs_column] + tcolumns[1:]
     _TraitRelation.__init__(self, traits_table, tablename, columns)
Esempio n. 10
0
 def create_entry(self, *args):
     var = dict(self.editor.dialogs['create'].items())
     debug('var is %s' % var)
     self.environ[self.trait][var['name']] = var['value']
     tagname = ujoin(self.trait, var['name'])
     self.editor.make_tag(tagname)
     self.editor.destroy_dialog(self.editor.dialogs['create'])
Esempio n. 11
0
 def _trait_select_dialog(self, name):
     dialog = dialogs.CList(name, name=name)
     self.main.set_table(ujoin(self.browser.suite, 'traits'))
     traits = self.main.select(fields=['trait'])
     dialog.set_rows(traits)
     dialog.set_ok(self.select_trait)
     dialog.set_cancel(self.destroy_dialog)
     self.dialogs[name] = dialog
Esempio n. 12
0
 def __init__(self, suite, traits_table, prio_table):
     tablename = ujoin(suite, "traits")
     columns = trait_columns()
     trait = getcolumn("trait", columns)
     priority = getcolumn("priority", columns)
     trait.set_fk(traits_table)
     priority.set_fk(prio_table)
     Table.__init__(self, tablename, columns)
Esempio n. 13
0
 def __init__(self, suite, traits_table, packages_table):
     tablename = ujoin(suite, "templates")
     packs_column = PkBigname("package")
     packs_column.set_fk(packages_table)
     tcolumns = template_columns()
     tcolumns[-1].set_fk("textfiles")
     columns = tcolumns[:1] + [packs_column] + tcolumns[1:]
     _TraitRelation.__init__(self, traits_table, tablename, columns)
Esempio n. 14
0
 def __init__(self, suite, traits_table, packages_table):
     packs_column = PkBigname("package")
     packs_column.set_fk(packages_table)
     action_column = Name("action")
     action_column.constraint.default = "install"
     columns = [packs_column, action_column]
     tablename = ujoin(suite, "trait", "package")
     _TraitRelation.__init__(self, traits_table, tablename, columns)
Esempio n. 15
0
 def __init__(self, suite, traits_table, prio_table):
     tablename = ujoin(suite, 'traits')
     columns = trait_columns()
     trait = getcolumn('trait', columns)
     priority = getcolumn('priority', columns)
     trait.set_fk(traits_table)
     priority.set_fk(prio_table)
     Table.__init__(self, tablename, columns)
Esempio n. 16
0
 def __init__(self, conn, suite, name='TraitsWindow'):
     self.cmd = StatementCursor(conn, name=name)
     self.cmd.set_table(ujoin(suite, 'traits'))
     rows = self.cmd.select()
     packer = lambda x : rowpacker('trait', x)
     DragListWindow.__init__(self, '%s traits' % suite, packer, rows,
                     TARGETS.get('trait', suite), name=name)
     self.set_size_request(400, 300)
Esempio n. 17
0
 def __init__(self, suite, traits_table, packages_table):
     packs_column = PkBigname('package')
     packs_column.set_fk(packages_table)
     action_column = Name('action')
     action_column.constraint.default = 'install'
     columns = [packs_column, action_column]
     tablename = ujoin(suite, 'trait', 'package')
     _TraitRelation.__init__(self, traits_table, tablename, columns)
Esempio n. 18
0
 def __init__(self, suite, traits_table, prio_table):
     tablename = ujoin(suite, 'traits')
     columns = trait_columns()
     trait = getcolumn('trait', columns)
     priority = getcolumn('priority', columns)
     trait.set_fk(traits_table)
     priority.set_fk(prio_table)
     Table.__init__(self, tablename, columns)
Esempio n. 19
0
def insert_suite_packages(cursor, repos):
    suite = repos.source.suite
    if isnonus(suite):
        suite = suite.split('/')[0]
    table = ujoin(suite, 'packages')
    for section in repos.source.sections:
        for package in repos.full_parse(section).values():
            cursor.insert(table, package_to_row(package))
Esempio n. 20
0
 def __init__(self, suite, traits_table, packages_table):
     packs_column = PkBigname('package')
     packs_column.set_fk(packages_table)
     action_column = Name('action')
     action_column.constraint.default = 'install'
     columns = [packs_column, action_column]
     tablename = ujoin(suite, 'trait', 'package')
     _TraitRelation.__init__(self, traits_table, tablename, columns)
Esempio n. 21
0
 def insert_item(self, order, fields, value):
     fieldkeys = self['___field_keys___']
     orders = self['___orders___']
     for k,v in zip(orders[order], fields):
         fieldkeys[k].add(v)
     fullkey = ujoin(*fields)
     self[fullkey] = value
     self['___field_keys___'] = fieldkeys
Esempio n. 22
0
 def _trait_select_dialog(self, name):
     dialog = dialogs.CList(name, name=name)
     self.main.set_table(ujoin(self.browser.suite, 'traits'))
     traits = self.main.select(fields=['trait'])
     dialog.set_rows(traits)
     dialog.set_ok(self.select_trait)
     dialog.set_cancel(self.destroy_dialog)
     self.dialogs[name] = dialog
Esempio n. 23
0
 def __init__(self, suite, traits_table):
     tablename = ujoin(suite, "scripts")
     script_column = PkName("script")
     script_column.set_fk("scriptnames")
     sfile_column = Num("scriptfile")
     sfile_column.set_fk("textfiles")
     script_columns = [script_column, sfile_column]
     _TraitRelation.__init__(self, traits_table, tablename, script_columns)
Esempio n. 24
0
 def insert_item(self, order, fields, value):
     fieldkeys = self['___field_keys___']
     orders = self['___orders___']
     for k, v in zip(orders[order], fields):
         fieldkeys[k].add(v)
     fullkey = ujoin(*fields)
     self[fullkey] = value
     self['___field_keys___'] = fieldkeys
Esempio n. 25
0
def insert_suite_packages(cursor, repos):
    suite = repos.source.suite
    if isnonus(suite):
        suite = suite.split('/')[0]
    table = ujoin(suite, 'packages')
    for section in repos.source.sections:
        for package in repos.full_parse(section).values():
            cursor.insert(table, package_to_row(package))
Esempio n. 26
0
 def __init__(self, profiles_table):
     profile_col = PkName('profile')
     profile_col.set_fk(profiles_table)
     trait_col = PkName('trait')
     name_col = PkBigname('name')
     value_col = Text('value')
     cols = [profile_col, trait_col, name_col, value_col]
     tablename = ujoin('profile', 'variables')
     Table.__init__(self, tablename, cols)
Esempio n. 27
0
def insert_more_packages(cursor, repos, suite=None):
    repos.source.set_path()
    repos.parse_release()
    table = ujoin(suite, 'packages')
    for package in repos.full_parse().values():
        try:
            cursor.insert(table, package_to_row(package))
        except OperationalError:
            pass
Esempio n. 28
0
def insert_more_packages(cursor, repos, suite=None):
        repos.source.set_path()
        repos.parse_release()
        table = ujoin(suite, 'packages')
        for package in repos.full_parse().values():
            try:
                cursor.insert(table, package_to_row(package))
            except OperationalError:
                pass
Esempio n. 29
0
 def __init__(self, profiles_table):
     profile_col = PkName('profile')
     profile_col.set_fk(profiles_table)
     trait_col = PkName('trait')
     name_col = PkBigname('name')
     value_col = Text('value')
     cols = [profile_col, trait_col, name_col, value_col]
     tablename = ujoin('profile', 'variables')
     Table.__init__(self, tablename, cols)
Esempio n. 30
0
 def __init__(self, profiles_table):
     profile_col = PkName("profile")
     profile_col.set_fk(profiles_table)
     trait_col = PkName("trait")
     name_col = PkBigname("name")
     value_col = Text("value")
     cols = [profile_col, trait_col, name_col, value_col]
     tablename = ujoin("profile", "variables")
     Table.__init__(self, tablename, cols)
Esempio n. 31
0
 def __init__(self, conn, suite):
     table = ujoin(suite, 'templates')
     _TraitRelation.__init__(self, conn, suite, table, name='TraitTemplate')
     self.traitparent = TraitParent(conn, suite)
     self.template = Template()
     self.template.set_suite(suite)
     self.template_path = None
     self.textfiles = TextFileManager(self.conn)
     self._jtable = '%s as s join textfiles as t ' % table
     self._jtable += 'on s.templatefile = t.fileid' 
Esempio n. 32
0
 def __init__(self, conn, suite):
     table = ujoin(suite, 'templates')
     _TraitRelation.__init__(self, conn, suite, table, name='TraitTemplate')
     self.traitparent = TraitParent(conn, suite)
     self.template = Template()
     self.template.set_suite(suite)
     self.template_path = None
     self.textfiles = TextFileManager(self.conn)
     self._jtable = '%s as s join textfiles as t ' % table
     self._jtable += 'on s.templatefile = t.fileid' 
Esempio n. 33
0
 def __init__(self, conn, suite):
     Element.__init__(self, 'traits')
     self.conn = conn
     self.suite = suite
     self.setAttribute('suite', self.suite)
     self._traits_ = StatementCursor(self.conn, 'Traits')
     self._traits_.set_table(ujoin(self.suite, 'traits'))
     self.traitnames = [row.trait for row in self._traits_.select(order='trait')]
     for t in self.traitnames:
         t_element = Element('trait')
         t_element.setAttribute('name', t)
         self.appendChild(t_element)
Esempio n. 34
0
 def __init__(self, conn, suite):
     Element.__init__(self, 'traits')
     self.conn = conn
     self.suite = suite
     self.setAttribute('suite', self.suite)
     self._traits_ = StatementCursor(self.conn, 'Traits')
     self._traits_.set_table(ujoin(self.suite, 'traits'))
     self.traitnames = [row.trait for row in self._traits_.select(order='trait')]
     for t in self.traitnames:
         t_element = Element('trait')
         t_element.setAttribute('name', t)
         self.appendChild(t_element)
Esempio n. 35
0
 def __init__(self, *args):
     SimpleXMLRPCServer.__init__(self, *args)
     self.suites = ['sid', 'sarge', 'woody', 'woody/non-US']
     self.cfg = Configuration('repos')
     self.repos = dict([(suite, LocalRepos(self._srcline_(suite))) for suite in self.suites])
     self._fully_parsed = {}
     for suite, repos in self.repos.items():        
         repos.parse_release()
         repos.parse()
         for section in repos.source.sections:
             if suite == 'woody/non-US':
                 suite = 'woody'
             key = ujoin(suite, section)
             self._fully_parsed[key] = repos.full_parse(section)
Esempio n. 36
0
 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)
Esempio n. 37
0
 def __init__(self, *args):
     SimpleXMLRPCServer.__init__(self, *args)
     self.suites = ['sid', 'sarge', 'woody', 'woody/non-US']
     self.cfg = Configuration('repos')
     self.repos = dict([(suite, LocalRepos(self._srcline_(suite)))
                        for suite in self.suites])
     self._fully_parsed = {}
     for suite, repos in self.repos.items():
         repos.parse_release()
         repos.parse()
         for section in repos.source.sections:
             if suite == 'woody/non-US':
                 suite = 'woody'
             key = ujoin(suite, section)
             self._fully_parsed[key] = repos.full_parse(section)
Esempio n. 38
0
 def _clear_traits(self, suite):
     self.__set_suite_cursors__(suite)
     self.traitparent.cmd.delete()
     self.traitpackage.cmd.delete()
     self.main.delete(table=ujoin(suite, 'variables'))
     self.traits.delete()
Esempio n. 39
0
 def __init__(self, conn, suite):
     table = ujoin(suite, 'scripts')
     _TraitRelation.__init__(self, conn, suite, table, name='TraitScript')
     self.textfiles = TextFileManager(self.conn)
     self._jtable = '%s as s join textfiles as t ' % table
     self._jtable += 'on s.scriptfile = t.fileid' 
Esempio n. 40
0
 def __init__(self, conn, suite):
     table = ujoin(suite, 'trait', 'parent')
     _TraitRelation.__init__(self, conn, suite, table, name='TraitParent')
     self.graph = kjGraph([(r.trait, r.parent) for r in self.cmd.select()])
Esempio n. 41
0
 def __init__(self, conn, suite):
     table = ujoin(suite, 'scripts')
     _TraitRelation.__init__(self, conn, suite, table, name='TraitScript')
Esempio n. 42
0
 def __init__(self, suite, traits_table):
     parent_column = PkName('parent')
     parent_column.set_fk(traits_table, 'trait')
     columns = [parent_column]
     tablename = ujoin(suite, 'trait', 'parent')
     _TraitRelation.__init__(self, traits_table, tablename, columns)
Esempio n. 43
0
 def __init__(self, suite):
     tablename = ujoin(suite, 'packages')
     Table.__init__(self, tablename, packages_columns())
Esempio n. 44
0
 def export_full_parse(self, suite, section, package):
     return self._fully_parsed[ujoin(suite, section)][package]
Esempio n. 45
0
 def export_fp_keys(self, suite, section):
     return self._fully_parsed[ujoin(suite, section)].keys()
Esempio n. 46
0
 def export_full_parse(self, suite, section, package):
     return self._fully_parsed[ujoin(suite, section)][package]
Esempio n. 47
0
 def __init__(self, conn, suite):
     table = ujoin(suite, 'trait', 'parent')
     _TraitRelation.__init__(self, conn, suite, table, name='TraitParent')
     self.graph = kjGraph([(r.trait, r.parent) for r in self.cmd.select()])
Esempio n. 48
0
 def __init__(self, conn, suite, trait):
     self.suite = suite
     table = ujoin(suite, 'variables')
     Environment.__init__(self, conn, table, 'trait')
     self.set_main(trait)
Esempio n. 49
0
 def set_suite(self, suite):
     self.suite = suite
     self.set_table(ujoin(self.suite, 'traits'))
Esempio n. 50
0
 def export_fp_keys(self, suite, section):
     return self._fully_parsed[ujoin(suite, section)].keys()
Esempio n. 51
0
 def make_tag(self, menuitem, name, parent):
     parentname = parent.get_name()
     tagname = ujoin(parentname, name)
     self.editor.make_tag(tagname)
Esempio n. 52
0
 def __make_superdict__(self):
     self.__superdict__ = {}
     for field in self.main_values:
         for key in self.__keyfunction__(field):
             self.__superdict__[ujoin(field, key)] = (field, key)
Esempio n. 53
0
 def __init__(self, suite, traits_table):
     cols = [PkBigname('name'), Text('value')]
     tablename = ujoin(suite, 'variables')
     _TraitRelation.__init__(self, traits_table, tablename, cols)
Esempio n. 54
0
 def get_value(self, keys):
     return self[ujoin(*keys)]
Esempio n. 55
0
 def __init__(self, suite, traits_table, packages_table):
     tablename = ujoin(suite, 'debconf')
     _TraitRelation.__init__(self, traits_table, tablename, debconf_columns())
Esempio n. 56
0
 def __init__(self, conn, suite):
     table = ujoin(suite, 'trait', 'package')
     _TraitRelation.__init__(self, conn, suite, table, name='TraitPackage')
     self.cmd.set_fields(['package', 'action'])
     self.traitparent = TraitParent(conn, suite)
Esempio n. 57
0
 def __init__(self, conn, suite):
     table = ujoin(suite, 'debconf')
     _TraitRelation.__init__(self, conn, suite, table, name='TraitDebconf')
Esempio n. 58
0
 def _clear_traits(self, suite):
     self.__set_suite_cursors__(suite)
     self.traitparent.cmd.delete()
     self.traitpackage.cmd.delete()
     self.main.delete(table=ujoin(suite, 'variables'))
     self.traits.delete()