コード例 #1
0
 def suite_selection(self, button, data):
     print button, data
     dialog = dialogs.CList('select a suite', 'select suite')
     dialog.set_rows(self.suites.select(fields=['suite']))
     dialog.set_ok(self.suite_dialog_selected)
     dialog.set_cancel(self.destroy_dialog)
     self.dialogs['select suite'] = dialog
コード例 #2
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
コード例 #3
0
ファイル: environ.py プロジェクト: pombredanne/paella-svn
 def ask_remove_key(self):
     if self.dialogs['remove'] is None:
         self.dialogs['remove'] = dialogs.CList('remove which item',
                                                name='remove')
         d = self.dialogs['remove']
         d.set_rows(self.record.keys(), ['name'])
         self.dialogs['remove'].set_cancel(self.destroy_dialog)
         self.dialogs['remove'].set_ok(self.remove_item)
コード例 #4
0
 def pull_from_tar(self, button, fileselect):
     info, tfile = fileselect.extract_file()
     template = tfile.name
     action = 'attach'
     if self.dialogs[action] is None:
         msg = 'attach to which package?'
         self.dialogs[action] = dialogs.CList(msg, name=action)
         lbox = self.dialogs[action]
         lbox.set_rows(self.traitpackage.packages())
         lbox.set_ok(self.insert_new_template_from_tar)
         lbox.set_cancel(self.destroy_dialog)
         lbox.set_data('tarmember', (info, tfile))
コード例 #5
0
 def set_trait_selection(self, menuitem, command):
     print menuitem, command
     if command == 'all':
         self.browser.trait_selection = '_all_traits_'
         self.browser.reset_rows()
     else:
         dialog = dialogs.CList('hi there', name='select profile')
         profiles = self.main.select(fields=['profile'],
                                     table='profiles',
                                     clause=Eq('suite', self.suite))
         dialog.set_rows(profiles)
         dialog.set_ok(self.profile_dialog_selected)
         dialog.set_cancel(self.destroy_dialog)
         self.dialogs['select profile'] = dialog
コード例 #6
0
    def release_command(self, menuitem, action):
        print action
        if action == 'update section lists':
            rows = self.repos.local.check_all_dist_sections()
            dl = dialogs.CList('section lists status')
            dl.set_rows(rows)
            dl.set_usize(500, 300)
            bad_rows = [
                row for row in rows if row.status in ['missing', 'corrupt']
            ]
            jobs = [[self.repos.fulldistpath(row.path), row.full_path]
                    for row in bad_rows]
            if self.dialogs['downloads'] is None:
                self.dialogs['downloads'] = DownloadWindow()
                self.dialogs['downloads'].connect('destroy',
                                                  self.destroy_dialog)
            if self.dialogs['downloads'] is not None:
                for url, path in jobs:
                    self.dialogs['downloads'].pool.put(url, path)

        elif action == 'check for missing':
            status_rows = self.repos.local.check_all_sections()
            status_rows = [
                row for row in status_rows if row.status == 'missing'
            ]
            dl = dialogs.CList('status')
            dl.set_rows(status_rows)
            dl.set_usize(500, 300)
        elif action == 'check for corrupt':
            status_rows = self.repos.local.check_all_sections(quick=False)
            status_rows = [
                row for row in status_rows if row.status == 'corrupt'
            ]
            dl = dialogs.CList('status')
            dl.set_rows(status_rows)
            dl.set_usize(500, 300)
        self.reset_rows()
コード例 #7
0
 def edit_command(self, menuitem, name):
     if self.conn is None:
         dialogs.Message('Not Connected')
     else:
         if name == 'profiles':
             self.workspace['profiles'] = ProfileGenWin(self.conn, self.dbname)
         elif name in ['suitemanager']:
             if not self.dialogs[name]:
                 msg = 'select a suite'
                 self.dialogs[name] = dialogs.CList(msg, name=name)
                 lbox = self.dialogs[name]
                 lbox.set_rows(self.main.select(table='suites'))
                 lbox.set_ok(self.suite_selected)
                 lbox.set_cancel(self.destroy_dialog)
         else: self.run_tbar(None, name)
コード例 #8
0
 def ask_dialog(self, button, data):
     if not self.dialogs[data]:
         if data == 'create':
             self.dialogs[data] = dialogs.Entry('create profile',
                                                name='create')
             self.dialogs[data].set_ok(self.create_profile)
         elif data == 'copy':
             self.dialogs[data] = dialogs.CList('copy profile', name='copy')
             dialog = self.dialogs[data]
             dialog.set_rows(
                 self.profiles.select(fields='profile', order='profile'))
             dialog.set_ok(self.src_profile_selected)
         elif data == 'export':
             pdb = PaellaDatabase(self.conn)
             profiles = pdb.profiles
         self.dialogs[data].set_cancel(self.destroy_dialog)