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