def __init__(self, cfg=None): if cfg is None: cfg = PaellaConfig() dsn = cfg.get_dsn() dsn['dbusername'] = '******' PaellaConnection.__init__(self, dsn) print 'installer connection made'
def __init__(self, name='Manager'): CommandBoxWindow.__init__(self) self.cfg = PaellaConfig('database') self.dialogs = {}.fromkeys(['dbname', 'suitemanager']) apps = [ 'profiles', 'families', 'suitemanager', 'traitmanager', 'machines', 'traits', 'tdiff', 'sdiff', 'fdiff', 'default_environment', 'clients', 'browser' ] self.workspace = {}.fromkeys(apps) self.add_menu(dbcommands, 'database', self.database_command) self.add_menu(self.workspace.keys(), 'edit', self.edit_command) self.set_size_request(150, 200) self.conn = None self.dbname = None self.dblist = ScrollCList() self.vbox.add(self.dblist) conn = PaellaConnection(self.cfg) cursor = StatementCursor(conn, 'quicky') self.dblist.set_rows(cursor.select(table='pg_database')) cursor.close() conn.close() self.tbar.add_button('profiles', 'profile manager', self.run_tbar) self.tbar.add_button('families', 'family manager', self.run_tbar) self.tbar.add_button('machines', 'machine manager', self.run_tbar) self.tbar.add_button('traits', 'trait manager', self.run_tbar) self.tbar.add_button('tdiff', 'template differ', self.run_tbar) self.tbar.add_button('sdiff', 'script differ', self.run_tbar) self.tbar.add_button('fdiff', 'family differ', self.run_tbar)
def __init__(self, name='Manager'): CommandBoxWindow.__init__(self) self.cfg = PaellaConfig('database') self.dialogs = {}.fromkeys(['dbname', 'suitemanager']) apps = ['profiles', 'families', 'suitemanager', 'traitmanager', 'machines', 'traits', 'tdiff', 'sdiff', 'fdiff', 'default_environment', 'clients'] self.workspace = {}.fromkeys(apps) self.add_menu(dbcommands, 'database', self.database_command) self.add_menu(self.workspace.keys(), 'edit', self.edit_command) self.set_size_request(150,200) self.conn = None self.dbname = None self.dblist = ScrollCList() self.vbox.add(self.dblist) conn = PaellaConnection(self.cfg) cursor = StatementCursor(conn, 'quicky') self.dblist.set_rows(cursor.select(table='pg_database')) cursor.close() conn.close() self.tbar.add_button('profiles', 'profile manager', self.run_tbar) self.tbar.add_button('families', 'family manager', self.run_tbar) self.tbar.add_button('machines', 'machine manager', self.run_tbar) self.tbar.add_button('traits', 'trait manager', self.run_tbar) self.tbar.add_button('tdiff', 'template differ', self.run_tbar) self.tbar.add_button('sdiff', 'script differ', self.run_tbar) self.tbar.add_button('fdiff', 'family differ', self.run_tbar)
def __init__(self): object.__init__(self) self.cfg = PaellaConfig() self.conn = PaellaConnection() self.profile = os.environ['PAELLA_PROFILE'] self.target = os.environ['PAELLA_TARGET'] self.machine = None self.trait = None self.suite = get_suite(self.conn, self.profile) self.pr = Profile(self.conn) self.pr.set_profile(self.profile) self.traitlist = self.pr.make_traitlist() self.pe = ProfileEnvironment(self.conn, self.profile) self.tp = TraitParent(self.conn, self.suite) self.fm = Family(self.conn) self.tr = Trait(self.conn, self.suite) self.families = list( self.fm.get_related_families(self.pr.get_families())) self._envv = None self.default = DefaultEnvironment(self.conn) self.installer = TraitInstaller(self.conn, self.suite, self.cfg) if os.environ.has_key('PAELLA_MACHINE'): self.machine = os.environ['PAELLA_MACHINE'] if os.environ.has_key('PAELLA_TRAIT'): self.set_trait(os.environ['PAELLA_TRAIT'])
def dbconnect(self, dbname): self.cfg.change('database') dsn = self.cfg.get_dsn() dsn['dbname'] = dbname self.conn = PaellaConnection(dsn) self.main = StatementCursor(self.conn, 'mainManager') self.dbname = dbname dialogs.Message('connected to database %s' % dbname)
def __init__(self, name='Manager'): CommandBoxWindow.__init__(self) self.cfg = PaellaConfig('database') self.dialogs = {}.fromkeys(['dbname', 'suitemanager']) self.workspace = {}.fromkeys(['profiles', 'suitemanager', 'traitmanager', 'machines']) self.add_menu(dbcommands, 'database', self.database_command) self.add_menu(self.workspace.keys(), 'edit', self.edit_command) self.set_size_request(150,200) self.conn = None self.dbname = None self.dblist = ScrollCList() self.vbox.add(self.dblist) conn = PaellaConnection(self.cfg) cursor = StatementCursor(conn, 'quicky') self.dblist.set_rows(cursor.select(table='pg_database')) cursor.close() conn.close()
def __init__(self, name='Manager'): CommandBoxWindow.__init__(self) self.cfg = PaellaConfig('database') self.dialogs = {}.fromkeys(['dbname', 'suitemanager']) self.workspace = {}.fromkeys( ['profiles', 'suitemanager', 'traitmanager', 'machines']) self.add_menu(dbcommands, 'database', self.database_command) self.add_menu(self.workspace.keys(), 'edit', self.edit_command) self.set_size_request(150, 200) self.conn = None self.dbname = None self.dblist = ScrollCList() self.vbox.add(self.dblist) conn = PaellaConnection(self.cfg) cursor = StatementCursor(conn, 'quicky') self.dblist.set_rows(cursor.select(table='pg_database')) cursor.close() conn.close()
def __init__(self): object.__init__(self) self.cfg = PaellaConfig() self.conn = PaellaConnection() self.profile = os.environ['PAELLA_PROFILE'] self.target = os.environ['PAELLA_TARGET'] self.suite = get_suite(self.conn, self.profile) self.pe = ProfileEnvironment(self.conn, self.profile) self.tp = TraitParent(self.conn, self.suite)
def __init__(self, *args): KApplication.__init__(self) self.cfg = PaellaConfig() self.conn = PaellaConnection(self.cfg) self.db = BaseDatabase(self.conn, 'paelladb', None) dirs = KStandardDirs() self.tmpdir = str(dirs.findResourceDir('tmp', '/')) self.datadir = str(dirs.findResourceDir('data', '/')) self.socketdir = str(dirs.findResourceDir('socket', '/')) dsn = {}
CommandBoxWindow.__init__(self, name=name) self.conn = conn self.set_title(name) if type == 'template': self.browser = TemplateDiffer(self.conn) elif type == 'family': self.browser = FamilyDiffer(self.conn) else: self.browser = ScriptDiffer(self.conn) self.vbox.add(self.browser) if __name__ == '__main__': from paella.profile.base import PaellaConnection from gtk import mainloop, mainquit c = PaellaConnection() twin = DifferWin(c, 'template') twin.connect('destroy', mainquit) swin = DifferWin(c, 'script') swin.connect('destroy', mainquit) def dtable(): cmd.execute('drop table themebase') def dtables(): for t in cmd.tables(): if t not in ['footable']: cmd.execute('drop table %s' % t) #dtables() mainloop()
class MachineDatabaseElement(Element): def __init__(self, conn): Element.__init__(self, 'machine_database') self.conn = conn self.filesystems = FilesystemsElement(conn) self.disks = DisksElement(conn) self.mounts = MountsElement(conn) self.mtypes = MachineTypesElement(conn) self.kernels = KernelsElement(conn) self.machines = MachinesElement(conn) for e in [ self.machines, self.mtypes, self.disks, self.mounts, self.filesystems, self.kernels ]: self.appendChild(e) if __name__ == '__main__': from paella.profile.base import PaellaConfig, PaellaConnection cfg = PaellaConfig() conn = PaellaConnection(cfg) #f = FilesystemElement('newfs', 'home', 5) filesystems = FilesystemsElement(conn) disks = DisksElement(conn) mounts = MountsElement(conn) mtypes = MachineTypesElement(conn) kernels = KernelsElement(conn) machines = MachinesElement(conn) md = MachineDatabaseElement(conn)