Exemplo n.º 1
0
 def template_command(self, meuitem, command):
     if command in ['new']:
         path = self.trait_temp_path(filesel=True)
         select_a_file('new', path, self.fileselect_ok)
     elif command == 'diff':
         path = self.suite_template_path(filesel=True)
         select_a_file('load', path, self.fileselect_ok)
     elif command == 'save':
         self.save_template()
     elif command == 'load':
         path = self.suite_template_path(filesel=True)
         select_a_file('load', path, self.fileselect_ok)
     elif command == 'done':
         try:
             template = self.get_selected_data()[0].template
             self.remove_page(template)
         except IndexError:
             pass
     elif command == 'drop':
         print 'need to drop template'
         rows = self.get_selected_data()
         if len(rows):
             row = rows[0]
             self.traittemplate.drop_template(row.package, row.template)
             self.remove_page(row.template)
             self.reset_rows()
         else:
             dialogs.Message('a template must be selected')
     elif command == 'root':
         if self.dialogs['rootsel'] is None:
             path = self.tarball_path + '/'
             select_a_file('root', path, self.tarball_selected)
     elif command == 'edit':
         self.edit_template()
Exemplo n.º 2
0
 def template_command(self, meuitem, command):
     if command in ['new']:
         path = self.trait_temp_path(filesel=True)
         select_a_file('new', path, self.fileselect_ok)
     elif command == 'diff':
         path = self.suite_template_path(filesel=True)
         select_a_file('load', path, self.fileselect_ok)
     elif command == 'save':
         self.save_template()
     elif command == 'load':
         path = self.suite_template_path(filesel=True)
         select_a_file('load', path, self.fileselect_ok)
     elif command == 'done':
         try:
             template = self.get_selected_data()[0].template
             self.remove_page(template)
         except IndexError:
             pass
     elif command == 'drop':
         print 'need to drop template'
         rows = self.get_selected_data()
         if len(rows):
             row = rows[0]
             self.traittemplate.drop_template(row.package, row.template)
             self.remove_page(row.template)
             self.reset_rows()
         else:
             dialogs.Message('a template must be selected')
     elif command == 'root':
         if self.dialogs['rootsel'] is None:
             path = self.tarball_path + '/'
             select_a_file('root', path, self.tarball_selected)
     elif command == 'edit':
         self.edit_template()
Exemplo n.º 3
0
 def modify_trait(self, menuitem, action):
     if action == 'hello':
         dialogs.Message('hello')
     elif action in ['import', 'update']:
         filesel = select_a_file(action, self.tarball_path + '/', self.select_trait_tarball)
     elif action in ['updatedir', 'exportdir', 'importdir']:
         filesel = select_a_file(action, self.tarball_path + '/', self.select_traitdir)
     elif action == 'export':
         try:
             trait = self.listbox.get_selected_data()[0].trait
             #self.pages[trait].extract_packages()
             self.select_export_path(trait)
         except IndexError:
             dialogs.Message('no trait selected')
         
     elif action == 'extract':
         try:
             trait = self.listbox.get_selected_data()[0].trait
             self.pages[trait].extract_packages()
         except IndexError:
             dialogs.Message('no trait selected')
Exemplo n.º 4
0
 def template_command(self, meuitem, command):
     if command in ['new']:
         path = self.trait_temp_path(filesel=True)
         select_a_file('new', path, self.fileselect_ok)
     elif command == 'diff':
         path = self.suite_template_path(filesel=True)
         select_a_file('load', path, self.fileselect_ok)
     elif command == 'save':
         self.save_template()
     elif command == 'load':
         path = self.suite_template_path(filesel=True)
         select_a_file('load', path, self.fileselect_ok)
     elif command == 'done':
         try:
             template = self.get_selected_data()[0].template
             self.remove_page(template)
         except IndexError:
             pass
     elif command in ['drop', 'real_templates', 'other_templates']:
         rows = self.get_selected_data()
         row = None
         print row, rows, len(rows)
         if len(rows):
             row = rows[0]
         else:
             dialogs.Message('a template must be selected')
             print row, rows
         if row:
             package, template = row.package, row.template
             print row, 'ifrow'
             if command == 'drop':
                 self.traittemplate.drop_template(package, template)
                 self.remove_page(template)
             elif command == 'real_templates':
                 self.traittemplate.prefix_template(package,
                                                    template,
                                                    type_='real')
                 print 'make it real_templates'
             elif command == 'other_templates':
                 self.traittemplate.prefix_template(package,
                                                    template,
                                                    type_='other')
                 print 'make it other_templates'
             self.reset_rows()
     elif command == 'root':
         if self.dialogs['rootsel'] is None:
             path = self.tarball_path + '/'
             select_a_file('root', path, self.tarball_selected)
     elif command == 'edit':
         self.edit_template()
Exemplo n.º 5
0
    def modify_trait(self, menuitem, action):
        if action == 'hello':
            dialogs.Message('hello')
        elif action in ['import', 'update']:
            filesel = select_a_file(action, self.tarball_path + '/',
                                    self.select_trait_tarball)
        elif action in ['updatedir', 'exportdir', 'importdir']:
            filesel = select_a_file(action, self.tarball_path + '/',
                                    self.select_traitdir)
        elif action == 'export':
            try:
                trait = self.listbox.get_selected_data()[0].trait
                #self.pages[trait].extract_packages()
                self.select_export_path(trait)
            except IndexError:
                dialogs.Message('no trait selected')

        elif action == 'extract':
            try:
                trait = self.listbox.get_selected_data()[0].trait
                self.pages[trait].extract_packages()
            except IndexError:
                dialogs.Message('no trait selected')
Exemplo n.º 6
0
 def template_command(self, meuitem, command):
     if command in ['new']:
         path = self.trait_temp_path(filesel=True)
         select_a_file('new', path, self.fileselect_ok)
     elif command == 'diff':
         path = self.suite_template_path(filesel=True)
         select_a_file('load', path, self.fileselect_ok)
     elif command == 'save':
         self.save_template()
     elif command == 'load':
         path = self.suite_template_path(filesel=True)
         select_a_file('load', path, self.fileselect_ok)
     elif command == 'done':
         try:
             template = self.get_selected_data()[0].template
             self.remove_page(template)
         except IndexError:
             pass
     elif command in ['drop', 'real_templates', 'other_templates']:
         rows = self.get_selected_data()
         row = None
         print row, rows, len(rows)
         if len(rows):
             row = rows[0]
         else:
             dialogs.Message('a template must be selected')
             print row, rows
         if row:
             package, template = row.package, row.template
             print row, 'ifrow'
             if command == 'drop':
                 self.traittemplate.drop_template(package, template)
                 self.remove_page(template)
             elif command == 'real_templates':
                 self.traittemplate.prefix_template(package, template, type_='real')
                 print 'make it real_templates'
             elif command == 'other_templates':
                 self.traittemplate.prefix_template(package, template, type_='other')
                 print 'make it other_templates'
             self.reset_rows()
     elif command == 'root':
         if self.dialogs['rootsel'] is None:
             path = self.tarball_path + '/'
             select_a_file('root', path, self.tarball_selected)
     elif command == 'edit':
         self.edit_template()
Exemplo n.º 7
0
 def select_export_path(self, trait):
     filesel = select_a_file(trait, self.tarball_path + '/',
                             self.export_path_selected)
Exemplo n.º 8
0
 def select_export_path(self, trait):
     filesel = select_a_file(trait, self.tarball_path + '/', self.export_path_selected)
Exemplo n.º 9
0
 def select_configdat(self, button=None, data=None, action='getconfig'):
     select_a_file(action, '/', self.filesel_ok)