コード例 #1
0
ファイル: __init__.py プロジェクト: pyroutes/pyroutes
 def render(self, template, data):
     """
     Return the X(HT)ML from based on the base template, with the given
     template parameter as the child template, and the data parameter passed
     to the templates.
     """
     if self.base_template:
         doc = xmltemplate.process_file(os.path.join(self.template_dir, template), data, False)
         data[self.inclusion_param] = doc
         master = xmltemplate.process_file(os.path.join(self.template_dir, self.base_template), data)
     else:
         master = xmltemplate.process_file(os.path.join(self.template_dir, template), data)
     return master.toxml()
コード例 #2
0
ファイル: __init__.py プロジェクト: eide/pyroutes
 def render(self, template, data):
     """
     """
     if self.base_template:
         doc = xmltemplate.process_file(
             os.path.join(self.template_dir, template), data, False)
         data[self.inclusion_param] = doc
         master = xmltemplate.process_file(
             os.path.join(self.template_dir, self.base_template), data);
     else:
         master = xmltemplate.process_file(
             os.path.join(self.template_dir, template), data)
     return master.toxml().encode("utf-8")
コード例 #3
0
ファイル: __init__.py プロジェクト: igoralves/pyroutes
 def render(self, template, data):
     """
     Return the X(HT)ML from based on the base template, with the given
     template parameter as the child template, and the data parameter passed
     to the templates.
     """
     if self.base_template:
         doc = xmltemplate.process_file(
             os.path.join(self.template_dir, template), data, False)
         data[self.inclusion_param] = doc
         master = xmltemplate.process_file(
             os.path.join(self.template_dir, self.base_template), data);
     else:
         master = xmltemplate.process_file(
             os.path.join(self.template_dir, template), data)
     return master.toxml().encode("utf-8")