def __init__(self, parent): BaseInstaller.__init__(self, parent.conn) self._parent = parent self.target = parent.target # we need this paelladir attribute for now # but may replace/redo this later self.paelladir = self.target / 'root/paella' self.profile = None self.suite = None self.profiletrait = ProfileTrait(self.conn) self._profile = Profile(self.conn) if False: # setup logfile if hasattr(parent, 'log'): self.log = parent.log self.log.info('profile installer initialized') else: raise RuntimeError, 'No logfile for parent defined' if hasattr(parent, 'mainlog'): self.mainlog = parent.mainlog name = self.__class__.__name__ self.mainlog.add_logger(name) self.log = self.mainlog.loggers[name] # make empty data dicts self.machine_data = {} self.familydata = {} self.profiledata = {}
def __init__(self, conn): self.conn = conn self.profile = Profile(self.conn) self.family = Family(self.conn) self.suite = None self.trait = None self.machine = MachineHandler(self.conn)
def __init__(self): object.__init__(self) self.cfg = PaellaConfig() self.conn = InstallerConnection() 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.installer = ProfileInstaller(self.conn) self.installer.set_logfile() self.installer.set_profile(self.profile) self.installer.set_target(self.target) 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 __init__(self, parent, profile): self.app = get_application_pointer() self.conn = self.app.conn self.profile = Profile(self.conn) self.profile.set_profile(profile) BaseAssigner.__init__(self, parent, name='FamilyAssigner', udbuttons=True) self.connect(self, SIGNAL('okClicked()'), self.slotInsertNewFamilies)
def __init__(self, app, parent, profile): self.profile = Profile(app.conn) self.profile.set_profile(profile) BaseAssigner.__init__(self, app, parent, name='TraitAssigner', udbuttons=True) self.connect(self, SIGNAL('okClicked()'), self.slotInsertNewTraits)
def __init__(self, conn, cfg): os.environ['DEBIAN_FRONTEND'] = 'noninteractive' Installer.__init__(self, conn, cfg) self.profiletrait = ProfileTrait(self.conn) self.profile = None self.installer = None self.cfg = cfg self._profile = Profile(self.conn) self.log.info('profile installer initialized')
def __init__(self, conn): os.environ['DEBIAN_FRONTEND'] = 'noninteractive' Installer.__init__(self, conn) self.profiletrait = ProfileTrait(self.conn) self.profile = None self.installer = None self._profile = Profile(self.conn) if hasattr(self, 'log'): self.log.info('profile installer initialized') self.mtypedata = {}
def __init__(self, app, parent): SimpleSplitWindow.__init__(self, app, parent, ProfileView, 'ProfileMainWindow') self.app = app self.initActions() self.initMenus() self.initToolbar() self.conn = app.conn self.cfg = app.cfg self.cursor = StatementCursor(self.conn) self.profile = Profile(self.conn) self.refreshListView() self.resize(600, 800) self.setCaption('paella profiles')
def __init__(self, parent): BaseSplitWindow.__init__(self, parent, ProfileView, name='ProfileMainWindow') self.initPaellaCommon() self.initActions() self.initMenus() self.initToolbar() self.cursor = self.conn.cursor(statement=True) self.profile = Profile(self.conn) self.refreshListView() self.resize(600, 800) self.splitter.setSizes([150, 450]) self.setCaption('Paella Profiles') self._dialog = None self.connect(self.mainView, PYSIGNAL('changeSuite'), self.slotChangeSuite)
def __init__(self, conn, suites, name='ProfileBrowser'): self.menu = self.__make_mainmenu_(suites) ListNoteBook.__init__(self, name=name) self.conn = conn self.profiles = Profile(self.conn) self.profiletrait = ProfileTrait(self.conn) self.family = Family(self.conn) self.pfamily = StatementCursor(self.conn) self.pfamily.set_table('profile_family') self.trait_menu = make_menu(['drop', 'order'], self.trait_command) self.pdata_menu = make_menu(['edit', 'drop'], self.variable_command) self.family_menu = make_menu(['drop'], self.family_command) self.reset_rows() self.append_page(ScrollCList(rcmenu=self.trait_menu), 'traits') self.append_page(ScrollCList(rcmenu=self.pdata_menu), 'variables') self.append_page(ScrollCList(rcmenu=self.family_menu), 'families') self.dialogs = {}.fromkeys(['order'])
def __init__(self, parent): BaseInstaller.__init__(self, parent.conn) self._parent = parent self.target = parent.target # we need this paelladir attribute for now # but may replace/redo this later self.paelladir = self.target / 'root/paella' self.profile = None self.suite = None self.profiletrait = ProfileTrait(self.conn) self._profile = Profile(self.conn) if hasattr(parent, 'mainlog'): self.mainlog = parent.mainlog name = self.__class__.__name__ self.mainlog.add_logger(name) self.log = self.mainlog.loggers[name] # make empty data dicts self.machine_data = {} self.familydata = {} self.profiledata = {}
def create_profile(self, button): name = button.get_name() debug(name) if name == 'create': profile = self.dialogs[name].get() self.destroy_dialog(self.dialogs[name]) profiles = [p.profile for p in self.profiles.select()] if profile not in profiles: skel_profile = self.cfg.get('management_gui', 'template_profile') if skel_profile in profiles: p = Profile(self.conn) p.set_profile(skel_profile) p.copy_profile(skel_profile, profile) else: suite = self.cfg.get('management_gui', 'default_profile_suite') self.profiles.insert(data={ 'profile': profile, 'suite': suite }) self.browser.reset_rows() else: dialogs.Dialog('there was a problem')
from useless.base.path import path from paella.base import PaellaConfig from paella.db import PaellaConnection from paella.db.trait import Trait from paella.db.family import Family from paella.db.profile import Profile from paella.db.machine import MachineHandler from paella.db.installer import InstallerManager from paella.db import DefaultEnvironment from paella.installer.toolkit import InstallerTools if __name__ == '__main__': cfg = PaellaConfig() conn = PaellaConnection() suite = 'bootstrap' t = Trait(conn, suite) f = Family(conn) p = Profile(conn) m = MachineHandler(conn) de = DefaultEnvironment(conn) im = InstallerManager(conn) #os.environ['PAELLA_MACHINE'] = 'testmachine' os.environ['PAELLA_PROFILE'] = 'default' os.environ['PAELLA_TARGET'] = path('/foo/bar') it = InstallerTools()
def __init__(self, app, **atts): BaseDocument.__init__(self, app, **atts) self.profile = Profile(self.conn)
def resetProfileObject(self): self.profile = Profile(self.conn)