docstamp/template.py
def from_template_file(cls, template_file_path, command=None):
        """ Factory function to create a specific document of the
        class given by the `command` or the extension of `template_file_path`.

        See get_doctype_by_command and get_doctype_by_extension.

        Parameters
        ----------
        template_file_path: str

        command: str

        Returns
        -------
        doc

        """
        # get template file extension
        ext = os.path.basename(template_file_path).split('.')[-1]

        try:
            doc_type = get_doctype_by_command(command)
        except ValueError:
            doc_type = get_doctype_by_extension(ext)
        except:
            raise
        else:
            return doc_type(template_file_path)
def from_template_file(cls, template_file_path, command=None):
        # get template file extension
        ext = os.path.basename(template_file_path).split('.')[-1]

        try:
            doc_type = get_doctype_by_command(command)
        except ValueError:
            doc_type = get_doctype_by_extension(ext)
        except:
            raise
        else:
            return doc_type(template_file_path)
def from_template_file ( cls , template_file_path , command = None ) : # get template file extension ext = os . path . basename ( template_file_path ) . split ( '.' ) [ - 1 ] try : doc_type = get_doctype_by_command ( command ) except ValueError : doc_type = get_doctype_by_extension ( ext ) except : raise else : return doc_type ( template_file_path )
Factory function to create a specific document of the
        class given by the `command` or the extension of `template_file_path`.

        See get_doctype_by_command and get_doctype_by_extension.

        Parameters
        ----------
        template_file_path: str

        command: str

        Returns
        -------
        doc
Factory function to create a specific document of the class given by the command or the extension of template_file_path .