示例#1
0
 def __init__(self, name):
     Element.__init__(self, 'family')
     self.setAttribute('name', name)
     self.parents = Element('parents')
     self.environ = Element('environ')
     self.appendChild(self.parents)
     self.appendChild(self.environ)
示例#2
0
 def __init__(self, apt_id, uri, dist, sections, local_path):
     Element.__init__(self, 'aptsource')
     self.setAttribute('apt_id', apt_id)
     self.setAttribute('uri', uri)
     self.setAttribute('dist', dist)
     self.setAttribute('sections', sections)
     self.setAttribute('local_path', local_path)
示例#3
0
 def __init__(self, conn, machines=None):
     raise RuntimeError , "ClientMachineDatabaseElement isn't working"
     Element.__init__(self, 'machine_database')
     self.conn = conn
     if machines is not None:
         self.machines = MachinesElement(conn, machines)
         self.appendChild(self.machines)
示例#4
0
 def __init__(self, name, localpath, paramvalues=[],
              responsedestination=None):
     Element.__init__(self, 'METHODCALL')
     self.setName(name)
     self.appendChild(localpath)
     self.appendChildren(paramvalues)
     self.appendOptionalChild(responsedestination)
示例#5
0
 def __init__(self, suite, nonus=False, updates=False, local=False, common=False):
     Element.__init__(self, 'suite')
     self.setAttribute('name', suite)
     self.setAttribute('nonus', nonus)
     self.setAttribute('updates', updates)
     self.setAttribute('local', local)
     self.setAttribute('common', common)
示例#6
0
 def __init__(self, suite, nonus=False, updates=False, local=False, common=False):
     Element.__init__(self, "suite")
     self.setAttribute("name", suite)
     self.setAttribute("nonus", nonus)
     self.setAttribute("updates", updates)
     self.setAttribute("local", local)
     self.setAttribute("common", common)
示例#7
0
    def __init__(self, ownerDocument, name=""):
        Element.__init__(self, TAG_CATEGORY)
        self.name = name
        self.ownerDocument = ownerDocument
        self._items = []

        self.setAttribute("name", self.name)
示例#8
0
    def __init__(self, name, type, value, is_array=None,
                 array_size=None, qualifier_scopes={},
                 overridable=None, tosubclass=None,
                 toinstance=None, translatable=None):

        Element.__init__(self, 'QUALIFIER.DECLARATION')
        self.setName(name)
        self.setAttribute('TYPE', type)
        if is_array is not None:
            self.setOptionalAttribute('ISARRAY', str(is_array).lower())
        if array_size is not None:
            self.setAttribute('ARRAYSIZE', str(array_size))
        if overridable is not None:
            self.setAttribute('OVERRIDABLE', str(overridable).lower())
        if tosubclass is not None:
            self.setAttribute('TOSUBCLASS', str(tosubclass).lower())
        if toinstance is not None:
            self.setAttribute('TOINSTANCE', str(toinstance).lower())
        if translatable is not None:
            self.setAttribute('TRANSLATABLE', str(translatable).lower())

        if qualifier_scopes:
            scope = SCOPE(qualifier_scopes)
            self.appendOptionalChild(scope)
        if value is not None:
            if is_array:
                xval = VALUE_ARRAY(value)
            else:
                xval = VALUE(value)
            self.appendOptionalChild(xval)
示例#9
0
    def __init__(
        self,
        name,
        type,
        value=None,
        propagated=None,
        overridable=None,
        tosubclass=None,
        toinstance=None,
        translatable=None,
        xml_lang=None,
    ):

        Element.__init__(self, "QUALIFIER")

        self.setName(name)
        self.setAttribute("TYPE", type)

        if propagated is not None:
            self.setAttribute("PROPAGATED", str(propagated).lower())

        if overridable is not None:
            self.setAttribute("OVERRIDABLE", str(overridable).lower())
        if tosubclass is not None:
            self.setAttribute("TOSUBCLASS", str(tosubclass).lower())
        if toinstance is not None:
            self.setAttribute("TOINSTANCE", str(toinstance).lower())
        if translatable is not None:
            self.setAttribute("TRANSLATABLE", str(translatable).lower())

        self.setOptionalAttribute("xml:lang", xml_lang)

        self.appendOptionalChild(value)
示例#10
0
 def __init__(self, name, data=None, paramtype=None,
              embedded_object=None):
     Element.__init__(self, 'PARAMVALUE')
     self.setName(name)
     self.setOptionalAttribute('PARAMTYPE', paramtype)
     self.setOptionalAttribute('EmbeddedObject', embedded_object)
     self.appendOptionalChild(data)
示例#11
0
    def __init__(
        self,
        name,
        type,
        value_array=None,
        array_size=None,
        class_origin=None,
        propagated=None,
        qualifiers=[],
        xml_lang=None,
        embedded_object=None,
    ):

        Element.__init__(self, "PROPERTY.ARRAY")

        self.setName(name)
        self.setAttribute("TYPE", type)

        if array_size is not None:
            self.setAttribute("ARRAYSIZE", str(array_size))
        self.setOptionalAttribute("CLASSORIGIN", class_origin)
        self.setOptionalAttribute("EmbeddedObject", embedded_object)

        if propagated is not None:
            self.setAttribute("PROPAGATED", str(propagated).lower())

        self.setOptionalAttribute("xml:lang", xml_lang)

        self.appendChildren(qualifiers)
        self.appendOptionalChild(value_array)
示例#12
0
 def __init__(self, name, type, array_size=None, qualifiers=[]):
     Element.__init__(self, "PARAMETER.ARRAY")
     self.setName(name)
     self.setAttribute("TYPE", type)
     if array_size is not None:
         self.setAttribute("ARRAYSIZE", str(array_size))
     self.appendChildren(qualifiers)
示例#13
0
 def __init__(self, name, reference_class=None, array_size=None, qualifiers=[]):
     Element.__init__(self, "PARAMETER.REFARRAY")
     self.setName(name)
     self.setOptionalAttribute("REFERENCECLASS", reference_class)
     if array_size is not None:
         self.setAttribute("ARRAYSIZE", str(array_size))
     self.appendChildren(qualifiers)
示例#14
0
 def __init__(self, conn, path='/'):
     Element.__init__(self, 'paelladatabase')
     self.conn = conn
     self.stmt = StatementCursor(self.conn)
     self._profile_traits_ = ProfileTrait(self.conn)
     self.path = path
     self.aptsources = AptSourceListElement()
     self.appendChild(self.aptsources)
     if 'apt_sources' in self.stmt.tables():
         for row in self.stmt.select(table='apt_sources', order=['apt_id']):
             element = AptSourceElement(row.apt_id, row.uri, row.dist, row.sections,
                                        row.local_path)
             self.aptsources.appendChild(element)
         self.suites = SuitesElement()
         self.appendChild(self.suites)
         for row in self._suite_rows():
             args = map(str, [row.suite, row.nonus, row.updates, row.local, row.common])
             element = SuiteElement(*args)
             for suiteapt in self.stmt.select(table='suite_apt_sources', order=['ord'],
                                              clause=Eq('suite', row.suite)):
                 element.appendChild(SuiteAptElement(row.suite,
                                                     suiteapt.apt_id, str(suiteapt.ord)))
             self.suites.appendChild(element)
     else:
         print 'WARNING, apt_sources table does not exist, backing up anyway'
     self.profiles = PaellaProfiles(self.conn)
     self.family = Family(self.conn)
     suites = [x.suite for x in self._suite_rows()]
     for suite in suites:
         self.appendChild(TraitsElement(self.conn, suite))
示例#15
0
 def __init__(self, name, subtag_name, data, name_att='name'):
     Element.__init__(self, name)
     self.__data_dict__  = {}
     for key, value in data.items():
         self.__data_dict__[key] = TextElement(subtag_name, value)
         self.__data_dict__[key].setAttribute('name', key)
         self.appendChild(self.__data_dict__[key])
示例#16
0
 def __init__(self, mnt_name, mnt_point, fstype, mnt_opts, dump, pass_):
     Element.__init__(self, "mount")
     self.setAttribute("mnt_name", mnt_name)
     self.setAttribute("mnt_point", mnt_point)
     self.setAttribute("fstype", fstype)
     self.setAttribute("mnt_opts", mnt_opts)
     self.setAttribute("dump", dump)
     self.setAttribute("pass", pass_)
示例#17
0
 def __init__(self, name, suite):
     Element.__init__(self, "profile")
     self.setAttribute("name", name)
     self.setAttribute("suite", suite)
     self.traits = Element("traits")
     self.appendChild(self.traits)
     self.environ = Element("environ")
     self.appendChild(self.environ)
示例#18
0
 def __init__(self, name, rows, key=False):
     Element.__init__(self, name)
     for row in rows:
         if key:
             rowdata = PkRowElement(row[key], row)
         else:
             rowdata = RowElement(row)
         self.appendChild(rowdata)
示例#19
0
 def __init__(self):
     Element.__init__(self, 'paelladatabase')
     self.aptsources = AptSourceListElement()
     self.appendChild(self.aptsources)
     self.suites_element = SuitesElement()
     self.suites = {}
     self.suite_traits = {}
     self.appendChild(self.suites_element)
示例#20
0
 def __init__(self, name, data=None):
     Element.__init__(self, "METHODRESPONSE")
     self.setName(name)
     if data is not None:
         if type(data) == tuple or type(data) == list:
             self.appendChildren(data)
         else:
             self.appendChild(data)
示例#21
0
 def __init__(self, classname, data):
     Element.__init__(self, "INSTANCENAME")
     self.setAttribute("CLASSNAME", classname)
     if data is not None:
         if type(data) == list:
             self.appendChildren(data)
         else:
             self.appendChild(data)
示例#22
0
    def __init__(self, conn):
        Element.__init__(self, 'machine_database')
        self.conn = conn
        self.kernels = KernelsElement(conn)
        self.machines = MachineListElement(conn)

        for e in [self.machines, self.kernels]:
            self.appendChild(e)
示例#23
0
 def __init__(self, mnt_name, mnt_point, fstype, mnt_opts,
              dump, pass_):
     Element.__init__(self, 'mount')
     self.setAttribute('mnt_name', mnt_name)
     self.setAttribute('mnt_point', mnt_point)
     self.setAttribute('fstype', fstype)
     self.setAttribute('mnt_opts', mnt_opts)
     self.setAttribute('dump', dump)
     self.setAttribute('pass', pass_)
示例#24
0
 def __init__(self, conn):
     Element.__init__(self, "mounts")
     self.conn = conn
     self.cursor = StatementCursor(self.conn)
     self.cursor.set_table("mounts")
     self.mounts = []
     rows = self.cursor.select(order="mnt_name")
     for r in rows:
         self.append_mount(r.mnt_name, r.mnt_point, r.fstype, r.mnt_opts, r.dump, r["pass"])
示例#25
0
 def __init__(self, conn):
     Element.__init__(self, 'profiles')
     self.conn = conn
     self.stmt = StatementCursor(self.conn)
     self.env = ProfileEnvironment(self.conn)
     self.profiletraits = ProfileTrait(self.conn)
     self._profiles = {}
     for row in self.stmt.select(table='profiles', order='profile'):
         self._append_profile(row.profile, row.suite)
示例#26
0
 def __init__(self, conn):
     Element.__init__(self, 'mounts')
     self.conn = conn
     self.cursor = StatementCursor(self.conn)
     self.cursor.set_table('mounts')
     self.mounts = []
     rows = self.cursor.select(order='mnt_name')
     for r in rows:
         self.append_mount(r.mnt_name, r.mnt_point, r.fstype,
                           r.mnt_opts, r.dump, r['pass'])
示例#27
0
 def __init__(self, conn):
     Element.__init__(self, "filesystems")
     self.conn = conn
     self.cursor = StatementCursor(self.conn)
     filesystems = [r.filesystem for r in self.cursor.select(table="filesystems", order="filesystem")]
     self.filesystems = []
     for filesystem in filesystems:
         fs_element = FilesystemElement(self.conn, filesystem)
         self.filesystems.append(fs_element)
         self.appendChild(fs_element)
示例#28
0
 def __init__(self, name, suite):
     Element.__init__(self, 'profile')
     self.setAttribute('name', name)
     self.setAttribute('suite', suite)
     self.traits = Element('traits')
     self.appendChild(self.traits)
     self.families = Element('families')
     self.appendChild(self.families)
     self.environ = Element('environ')
     self.appendChild(self.environ)
示例#29
0
    def __init__(self, ownerDocument, name="", source="", played=""):
        Element.__init__(self, TAG_ITEM)
        self.name = name
        self.source = source
        self.played = played
        self.ownerDocument = ownerDocument

        self.setAttribute("source", self.source)
        self.setAttribute("played", self.played)
        self.appendChild(self.ownerDocument.createTextNode(self.name))
示例#30
0
 def __init__(self, conn):
     Element.__init__(self, 'kernels')
     self.conn = conn
     self.cursor = StatementCursor(self.conn)
     self.kernels = []
     kernels = [r.kernel for r in self.cursor.select(table='kernels', order='kernel')]
     for k in kernels:
         k_element = KernelElement(k)
         self.kernels.append(k_element)
         self.appendChild(k_element)
示例#31
0
 def __init__(self, data, message_id, protocol_version):
     Element.__init__(self, 'MESSAGE')
     self.setAttribute('ID', message_id)
     self.setAttribute('PROTOCOLVERSION', protocol_version)
     self.appendChild(data)
示例#32
0
 def __init__(self, mnt_name, ord, partition):
     Element.__init__(self, 'filesystem_mount')
     self.setAttribute('mnt_name', mnt_name)
     self.setAttribute('ord', ord)
     self.setAttribute('partition', partition)
示例#33
0
 def __init__(self, namespacepath, instancename):
     Element.__init__(self, 'INSTANCEPATH')
     self.appendChild(namespacepath)
     self.appendChild(instancename)
示例#34
0
 def __init__(self, data):
     Element.__init__(self, 'OBJECTPATH')
     self.appendChild(data)
示例#35
0
 def __init__(self, classname, properties=[], qualifiers=[], xml_lang=None):
     Element.__init__(self, 'INSTANCE')
     self.setAttribute('CLASSNAME', classname)
     self.setOptionalAttribute('xml:lang', xml_lang)
     self.appendChildren(qualifiers + properties)
示例#36
0
 def __init__(self, name, reference_class=None, qualifiers=[]):
     Element.__init__(self, 'PARAMETER.REFERENCE')
     self.setName(name)
     self.setOptionalAttribute('REFERENCECLASS', reference_class)
     self.appendChildren(qualifiers)
示例#37
0
 def __init__(self, diskname, device):
     Element.__init__(self, 'machine_disk')
     self.setAttribute('diskname', diskname)
     self.setAttribute('device', device)
示例#38
0
 def __init__(self, name):
     Element.__init__(self, 'machine_type')
     self.setAttribute('name', name)
     self.devices = []
     self.modules = []
     self.machine_type = name
示例#39
0
 def __init__(self, partition, start, size, id):
     Element.__init__(self, 'partition')
     self.setAttribute('partition', partition)
     self.setAttribute('start', start)
     self.setAttribute('size', size)
     self.setAttribute('Id', id)
示例#40
0
 def __init__(self, *args, **kwargs):
     Element.__init__(self, *args, **kwargs)
     self.ownerDocument = None
示例#41
0
 def __init__(self, suite, apt_id, order):
     Element.__init__(self, 'suiteapt')
     self.setAttribute('suite', suite)
     self.setAttribute('apt_id', apt_id)
     self.setAttribute('order', order)
示例#42
0
 def __init__(self):
     Element.__init__(self, 'debconfiguration')
示例#43
0
 def __init__(self, classname):
     Element.__init__(self, 'CLASSNAME')
     self.setName(classname)
示例#44
0
 def __init__(self, suite):
     Element.__init__(self, 'suite')
     self.setAttribute('name', suite)
示例#45
0
 def __init__(self, tag_name):
     Element.__init__(self, tag_name)
     self.ownerDocument = self
示例#46
0
 def __init__(self, doc_, name, id_=None, class_=None, style_=None):
     Element.__init__(self, name)
     self.ownerDocument = doc_
     self._id = id_
     if not (self._id == None):
         self.setAttribute("id", self._id)
示例#47
0
 def __init__(self, name, type, qualifiers=[]):
     Element.__init__(self, 'PARAMETER')
     self.setName(name)
     self.setAttribute('TYPE', type)
     self.appendChildren(qualifiers)
示例#48
0
 def __init__(self, conn):
     self.conn = conn
     Element.__init__(self, 'profile')
示例#49
0
 def __init__(self, name, data):
     Element.__init__(self, 'KEYBINDING')
     self.setName(name)
     self.appendChild(data)
示例#50
0
 def __init__(self, diskname):
     Element.__init__(self, 'diskname')
     self.setAttribute('name', diskname)
     self.partitions = []
     self.diskname = diskname
示例#51
0
 def __init__(self, tag):
     Element.__init__(self, tag)
示例#52
0
 def __init__(self, suite):
     Element.__init__(self, 'traits')
     self.suite = suite
     self.setAttribute('suite', self.suite)
示例#53
0
 def __init__(self, localpath, instancename):
     Element.__init__(self, 'LOCALINSTANCEPATH')
     self.appendChild(localpath)
     self.appendChild(instancename)
示例#54
0
 def __init__(self, ownerDoc, tagName):
     Element.__init__(self, tagName)
     CoreAttributes.__init__(self)
     if ownerDoc:
         self.ownerDocument= ownerDoc
示例#55
0
 def __init__(self, namespacepath, classname):
     Element.__init__(self, 'CLASSPATH')
     self.appendChild(namespacepath)
     self.appendChild(classname)
示例#56
0
 def __init__(self):
     Element.__init__(self, 'suites')
示例#57
0
 def __init__(self):
     Element.__init__(self, 'aptsources')
示例#58
0
 def __init__(self, localnamespacepath, classname):
     Element.__init__(self, 'LOCALCLASSPATH')
     self.appendChild(localnamespacepath)
     self.appendChild(classname)
示例#59
0
 def __init__(self, name):
     Element.__init__(self, 'script')
     self.setAttribute('name', name)
示例#60
0
 def __init__(self, name):
     Element.__init__(self, 'NAMESPACE')
     self.setName(name)