Exemple #1
0
 def get_class_docstring(self, class_indent, attr):
     with open(
             os.path.join(self.location, '..',
                          'styles/{}-{}.txt'.format(self.style, 'class')),
             'r') as f:
         self.template = ibis.Template(f.read())
     docstring = self.template.render(indent=self.indent, attr=attr)
     return self._docstring_helper(class_indent, docstring)
Exemple #2
0
 def get_method_docstring(self, method_indent, args, returns, yields,
                          raises):
     with open(
             os.path.join(self.location, '..',
                          'styles/{}-{}.txt'.format(self.style, 'method')),
             'r') as f:
         self.template = ibis.Template(f.read())
     docstring = self.template.render(indent=self.indent,
                                      args=args,
                                      raises=raises,
                                      returns=returns,
                                      yields=yields)
     return self._docstring_helper(method_indent, docstring)
Exemple #3
0
def get_template():
    with open('static/index.html') as index_file:
        return ibis.Template(index_file.read())
Exemple #4
0
def get_template():
    index = config.BASE_DIR / 'static/index.html'
    with index.open() as index_file:
        return ibis.Template(index_file.read())