def __init__(self, conn, suite, name='ScriptManager'): MenuWindow.__init__(self, name=name) self.set_title('%s script manager' % suite) self.conn = conn self.suite = suite self.browser = TraitScriptBrowser(self.conn, self.suite) self.vbox.add(self.browser) self.set_size_request(600, 400)
def __init__(self, conn, name='RepositoryBrowserWindow'): MenuWindow.__init__(self, name=name) self.conn = conn self.browser = RepositoryBrowser(self.conn) self.vbox.add(self.browser) self.add_menu(['add', 'remove'], 'repository', self.repos_command) self.set_usize(600, 450) self.dialogs = {}.fromkeys(['add-source', 'add-repos'])
def __init__(self, conn, suite): MenuWindow.__init__(self) self.set_title('%s template manager' % suite) self.conn = conn self.suite = suite self.main = StatementCursor(self.conn) self.browser = TraitTemplateBrowser(self.conn, suite) self.vbox.add(self.browser) self.add_menu(['all', 'profile'], 'selection', self.set_trait_selection) self.add_menu(TEMPL_CMDS, 'template', self.template_command) tc = TRAIT_TEMPL_CMDS self.add_menu(tc, 'trait', self.trait_command) self.set_size_request(600,400) self.dialogs = {}.fromkeys(['select trait', 'select profile']) self.browser.set_suite(suite)
def __init__(self, conn, suite, trait, tmp_path, name='ConfigGen'): MenuWindow.__init__(self) self.__original_text__ = '' self.editor = TemplateEnvironment(conn) self.editor.set_suite(suite) self.editor.set_trait(trait) self.vbox.add(self.editor) self.conn = conn self.__add_menus__() self.filename = '' self.filesel = None self.set_size_request(600, 500) self.cfg = Configuration() self.cfg.section = 'paella-admin' self.conf_path = self.cfg['config_path'] self.template_path = pjoin(self.cfg['template_path'], suite, trait) self.tmp_path = tmp_path makepaths(self.template_path) self.dialogs = {}.fromkeys(['template_record', 'environment'])
def __init__(self, maxthreads=3): VBox.__init__(self) self.threads = [] self.queue = DownloadQueue() self.show() for i in range(maxthreads): thread = _DownloadStatus(self.queue) thread.start() self.threads.append(thread) self.pack_end(thread, FALSE, FALSE, 0) def put(self, url, path): self.queue.put(url, path) if __name__ == '__main__': threads_init() win = MenuWindow() win.connect('destroy', mainquit) win.set_usize(200, 100) #url = 'http://paella/debian/dists/sid/Release' mirror = 'paella' #mirror = 'ftp.us.debian.org' url = 'http://%s/debian/dists/sid/main/binary-i386/Packages.gz' % mirror dl = DownloadStatus(url, 'hellothere') win.vbox.add(dl) #threads_enter() #dl.start() mainloop() #threads_leave()
def __init__(self, conn): self.conn = conn self.win = MenuWindow() self.scroll = ScrollCList() self.win.vbox.add(self.scroll) self.s = StatementCursor(self.conn)
def __init__(self, conn, suite, trait, name='DebconfEditorWin'): MenuWindow.__init__(self) self.set_name(name) self.debconf = DebconfEditor(conn, suite, trait, name=name) self.vbox.add(self.debconf)
self.tbar.add_button('update', 'update', self.reset_rows) self.tbar.add_button('delete', 'delete', self.delete_row) self.reset_rows() def reset_rows(self, *args): self.dcbox.set_rows(self.dc.cmd.select()) def delete_row(self, button, data): rows = self.dcbox.get_selected_data() if len(rows) != 1: dialogs.Message('need to select something') else: r = rows[0] self.dc.delete(r.name, r.trait) if __name__ == '__main__': conn = PaellaConnection() win = MenuWindow() dc = DebconfEditor(conn, 'sid', 'base') win.vbox.add(dc) win.show() win.connect('destroy', mainquit) mainloop() #if __name__ == '__main__':
def __init__(self, conn, suite, name='EnvironmentEditorWin'): MenuWindow.__init__(self) self.conn = conn self.editor = EnvironmentEditor(self.conn, suite) self.vbox.add(self.editor) self.add_menu(['update', 'revert'], 'sync', self.db_commands)
self.vbox.add(self.tdcbox) self.conn = conn self.suite = suite self.dc = TraitDebconf(self.conn, self.suite) self.tbar.add_button('update', 'update', self.reset_rows) self.tbar.add_button('delete', 'delete', self.delete_row) self.reset_rows() def reset_rows(self, *args): self.dcbox.set_rows(self.dc.cmd.select()) def delete_row(self, button, data): rows = self.dcbox.get_selected_data() if len(rows) != 1: dialogs.Message('need to select something') else: r = rows[0] self.dc.delete(r.name, r.trait) if __name__ == '__main__': conn = PaellaConnection() win = MenuWindow() dc = DebconfEditor(conn, 'sid', 'base') win.vbox.add(dc) win.show() win.connect('destroy', mainquit) mainloop() #if __name__ == '__main__':
def __init__(self, maxthreads=3): VBox.__init__(self) self.threads = [] self.queue = DownloadQueue() self.show() for i in range(maxthreads): thread = _DownloadStatus(self.queue) thread.start() self.threads.append(thread) self.pack_end(thread, FALSE, FALSE, 0) def put(self, url, path): self.queue.put(url, path) if __name__ == '__main__': threads_init() win = MenuWindow() win.connect('destroy', mainquit) win.set_usize(200, 100) #url = 'http://paella/debian/dists/sid/Release' mirror = 'paella' #mirror = 'ftp.us.debian.org' url = 'http://%s/debian/dists/sid/main/binary-i386/Packages.gz' %mirror dl = DownloadStatus(url, 'hellothere') win.vbox.add(dl) #threads_enter() #dl.start() mainloop() #threads_leave()