def __init__(self, conn, name='FamilyDiffer'): VBox.__init__(self) self.set_name(name) self.conn = conn self.view = TwinScrollCList(name=name) self.cursor = StatementCursor(self.conn) self.lfamily = Family(self.conn) self.rfamily = Family(self.conn) self.add(self.view) self.udbar = UDBar() self.pack_end(self.udbar, 0, 0, 0) self.show() self.udbar.ubutton.connect('clicked', self.update_pressed) self.udbar.dbutton.connect('clicked', self.diff_selection)
def export_client(self, client): cpath, ppath, fpath, tpath = self._cpaths_(client) makepaths(cpath) profiles, families, traits = self._client_schema(client) disks, mtypes, machines = self._client_mdata(client) if not disks: disks = None if not mtypes: mtypes = None if not machines: machines = None element = ClientMachineDatabaseElement(self.conn, disks, mtypes, machines) mdbpath = join(cpath, 'machine_database.xml') mdfile = file(mdbpath, 'w') mdfile.write(element.toprettyxml()) mdfile.close() if profiles: makepaths(ppath) pp = PaellaProfiles(self.conn) for profile in profiles: pp.write_profile(profile, ppath) if families: makepaths(fpath) f = Family(self.conn) for family in families: f.write_family(family, fpath) if traits: makepaths(tpath)
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 __init__(self, app, parent, name='FamilyList'): KListView.__init__(self, parent, name) dbwidget(self, app) self.family = Family(self.conn) self.setRootIsDecorated(True) self.addColumn('family') self.refreshlistView()
def __init__(self, conn): self.menu = make_menu(['delete'], self.modify_family) ListNoteBook.__init__(self) self.conn = conn self.family = Family(self.conn) self.var_menu = make_menu(['edit', 'nothing', 'nothing', 'drop'], self.var_menu_selected) self.parent_menu = make_menu(['drop'], self.modify_parent) self.reset_rows() self.append_page(ScrollCList(rcmenu=self.var_menu), 'environment') self.append_page(ScrollCList(rcmenu=self.parent_menu), 'parents') self.set_size_request(400, 300)
def import_client(self, client): cpath, ppath, fpath, tpath = self._cpaths_(client) profiles, families, traits = self._client_schema(client) mdbpath = join(cpath, 'machine_database.xml') if families: f = Family(self.conn) f.import_families(fpath) if profiles: pp = PaellaProcessor(self.conn) pp.main_path = cpath pp.insert_profiles() mh = MachineHandler(self.conn) md = mh.parse_xmlfile(mdbpath) mh.insert_parsed_element(md)
def __init__(self, app, parent): SimpleSplitWindow.__init__(self, app, parent, FamilyView, 'FamilyMainWindow') self.app = app self.initActions() self.initMenus() self.initToolbar() self.conn = app.conn self.cfg = app.cfg self.cursor = StatementCursor(self.conn) self.family = Family(self.conn) self.refreshListView() self.resize(600, 800) self.setCaption('paella families')
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, app, **atts): BaseDocument.__init__(self, app, **atts) self.family = Family(self.conn)
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)