Exemplo 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)
Exemplo n.º 2
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)
Exemplo 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)
Exemplo 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'])
Exemplo 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
Exemplo 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)
Exemplo n.º 7
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)
Exemplo 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
Exemplo 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)
Exemplo 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'])
Exemplo 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
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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))
Exemplo 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)
Exemplo 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
Exemplo 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
Exemplo 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)
Exemplo 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
Exemplo 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))
Exemplo 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)
Exemplo 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
Exemplo 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
Exemplo 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)
Exemplo 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)
Exemplo 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' 
Exemplo 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' 
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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()
Exemplo 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' 
Exemplo 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()])
Exemplo n.º 41
0
 def __init__(self, conn, suite):
     table = ujoin(suite, 'scripts')
     _TraitRelation.__init__(self, conn, suite, table, name='TraitScript')
Exemplo 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)
Exemplo n.º 43
0
 def __init__(self, suite):
     tablename = ujoin(suite, 'packages')
     Table.__init__(self, tablename, packages_columns())
Exemplo n.º 44
0
 def export_full_parse(self, suite, section, package):
     return self._fully_parsed[ujoin(suite, section)][package]
Exemplo n.º 45
0
 def export_fp_keys(self, suite, section):
     return self._fully_parsed[ujoin(suite, section)].keys()
Exemplo n.º 46
0
 def export_full_parse(self, suite, section, package):
     return self._fully_parsed[ujoin(suite, section)][package]
Exemplo 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()])
Exemplo 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)
Exemplo n.º 49
0
 def set_suite(self, suite):
     self.suite = suite
     self.set_table(ujoin(self.suite, 'traits'))
Exemplo n.º 50
0
 def export_fp_keys(self, suite, section):
     return self._fully_parsed[ujoin(suite, section)].keys()
Exemplo n.º 51
0
 def make_tag(self, menuitem, name, parent):
     parentname = parent.get_name()
     tagname = ujoin(parentname, name)
     self.editor.make_tag(tagname)
Exemplo 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)
Exemplo 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)
Exemplo n.º 54
0
 def get_value(self, keys):
     return self[ujoin(*keys)]
Exemplo n.º 55
0
 def __init__(self, suite, traits_table, packages_table):
     tablename = ujoin(suite, 'debconf')
     _TraitRelation.__init__(self, traits_table, tablename, debconf_columns())
Exemplo 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)
Exemplo n.º 57
0
 def __init__(self, conn, suite):
     table = ujoin(suite, 'debconf')
     _TraitRelation.__init__(self, conn, suite, table, name='TraitDebconf')
Exemplo 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()