Beispiel #1
0
 def construct(self):
     root = xmlutil.TemplateElement('extensions')
     elem = xmlutil.SubTemplateElement(root,
                                       'extension',
                                       selector='extensions')
     make_ext(elem)
     return xmlutil.MasterTemplate(root, 1, nsmap=ext_nsmap)
Beispiel #2
0
 def construct(self):
     root = MetadataTemplateElement('metadata', selector='metadata')
     elem = xmlutil.SubTemplateElement(root,
                                       'meta',
                                       selector=xmlutil.get_items)
     elem.set('key', 0)
     elem.text = 1
     return xmlutil.MasterTemplate(root, 1, nsmap=metadata_nsmap)
Beispiel #3
0
def make_ext(elem):
    elem.set('name')
    elem.set('namespace')
    elem.set('alias')
    elem.set('updated')

    desc = xmlutil.SubTemplateElement(elem, 'description')
    desc.text = 'description'

    xmlutil.make_links(elem, 'links')
    def construct(self):
        root = xmlutil.TemplateElement('services')
        elem = xmlutil.SubTemplateElement(root, 'service', selector='services')
        elem.set('binary')
        elem.set('host')
        elem.set('status')
        elem.set('state')
        elem.set('update_at')
        elem.set('disabled_reason')

        return xmlutil.MasterTemplate(root, 1)
Beispiel #5
0
def make_version(elem):
    elem.set('id')
    elem.set('status')
    elem.set('updated')

    mts = MediaTypesTemplateElement('media-types')
    elem.append(mts)

    mt = xmlutil.SubTemplateElement(mts, 'media-type', selector='media-types')
    mt.set('base')
    mt.set('type')

    xmlutil.make_links(elem, 'links')
Beispiel #6
0
 def construct(self):
     root = xmlutil.TemplateElement('versions')
     elem = xmlutil.SubTemplateElement(root, 'version', selector='versions')
     make_version(elem)
     return xmlutil.MasterTemplate(root, 1, nsmap=version_nsmap)