Example #1
0
def _register_services(uri):
    new_templates = {}
    tree = amara.parse(uri)
    for path in tree.xml_select("//service[@ident]/path[@template]"):
        ident = path.xml_parent.xml_attributes["ident"]
        template = path.xml_attributes["template"]
        new_templates[ident] = opensearch.make_template(template)
    return new_templates
Example #2
0
def _register_services(uri):
    new_templates = {}
    tree = amara.parse(uri)
    for path in tree.xml_select("//service[@ident]/path[@template]"):
        ident = path.xml_parent.xml_attributes["ident"]
        template = path.xml_attributes["template"]
        new_templates[ident] = opensearch.make_template(template)
    return new_templates
Example #3
0
 def internal_template(self):
     if self._internal_template is False:
         # No template is possible
         return None
     if self._internal_template is not None:
         # Cached version
         return self._internal_template
     # Compute the template
     if self.query_template is None:
         # No template available
         self._internal_template = False
         return None
     internal_template = global_config.internal_server_root + self.query_template
     self._internal_template = opensearch.make_template(internal_template)
     return self._internal_template
Example #4
0
 def internal_template(self):
     if self._internal_template is False:
         # No template is possible
         return None
     if self._internal_template is not None:
         # Cached version
         return self._internal_template
     # Compute the template
     if self.query_template is None:
         # No template available
         self._internal_template = False
         return None
     internal_template = global_config.internal_server_root + self.query_template
     self._internal_template = opensearch.make_template(internal_template)
     return self._internal_template
Example #5
0
def register_template(ident, template):
    if isinstance(template, basestring):
        template = opensearch.make_template(template)
    _registered_templates[ident] = template
Example #6
0
def register_template(ident, template):
    if isinstance(template, basestring):
        template = opensearch.make_template(template)
    _registered_templates[ident] = template