Exemple #1
0
 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()
Exemple #2
0
 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")
Exemple #3
0
 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")