Exemplo n.º 1
0
 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'])
Exemplo n.º 2
0
 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')
Exemplo n.º 3
0
 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')
Exemplo n.º 4
0
 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'])
Exemplo n.º 5
0
 def __init__(self, app, parent, profile):
     KMainWindow.__init__(self, parent, 'TraitAssigner')
     self.page = QFrame(self)
     self.vbox = QVBoxLayout(self.page, 5, 7)
     self.listBox = KActionSelector(self.page)
     self.listBox.setShowUpDownButtons(True)
     self.setCentralWidget(self.page)
     self.vbox.addWidget(self.listBox)
     hbox = QHBoxLayout(self.page, 5, 7)
     self.vbox.addLayout(hbox)
     self.ok_button = KPushButton('ok', self.page)
     self.cancel_button = KPushButton('cancel', self.page)
     hbox.addWidget(self.ok_button)
     hbox.addWidget(self.cancel_button)
     self.app = app
     self.db = app.db
     self.profile = Profile(app.conn)
     self.profile.set_profile(profile)
     self.suite = self.profile.current.suite
     self.traits = StatementCursor(app.conn)
     self.traits.set_table('%s_traits'  % self.suite)
     self.initlistView()
     self.show()
Exemplo n.º 6
0
 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')
Exemplo n.º 7
0
 def __init__(self, app, **atts):
     BaseDocument.__init__(self, app, **atts)
     self.profile = Profile(self.conn)
Exemplo n.º 8
0
import os

from paella.profile.base import PaellaConnection, PaellaConfig
from paella.profile.trait import Trait
from paella.profile.family import Family
from paella.profile.profile import Profile
from paella.machines.machine import MachineHandler

if __name__ == '__main__':
    cfg = PaellaConfig()
    conn = PaellaConnection()
    t = Trait(conn)
    f = Family(conn)
    p = Profile(conn)
    m = MachineHandler(conn)
Exemplo n.º 9
0
 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.slotLaughAtMe)