Module Expr Str ImportFrom alias Import alias ImportFrom alias alias Import alias Import alias ImportFrom alias alias FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Dict Str NameLoad body Expr Str If CompareIn Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr Assign NameStore Call NameLoad GeneratorExp TupleLoad NameLoad BinOpMod Str TupleLoad NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad If BoolOpOr CompareEq NameLoad Str CompareEq NameLoad Str body Expr Call NameLoad NameLoad NameLoad orelse If CompareEq NameLoad Str body Expr Call NameLoad NameLoad Str Expr Call NameLoad ListLoad Str Str Str SubscriptLoad NameLoad Index Str Str SubscriptLoad NameLoad Index Str keyword Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad Call NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad Str NameLoad Expr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str NameLoad NameLoad keyword NameLoad decorator_list
N/A N/A 
Based on http://www.djangosnippets.org/snippets/102/

Added by LS:

20090621
- template can now also be a list or tuple of filenames
- renamed parameter "type" to "outtype" 
- support for templates containing non-ascii data

 __future__ print_function N/A subprocess subprocess call PIPE N/A os N/A tempfile django.template loader Context process_latex N/A N/A template context outtype outfile N/A N/A pdf None N/A N/A 
    Processes a template as a LaTeX source file.
    Output is either being returned or stored in outfile.
    At the moment only pdf output is supported.
     N/A N/A N/A type template N/A list tuple N/A N/A t N/A N/A loader select_template template N/A N/A t N/A N/A loader get_template template N/A c N/A Context context N/A r N/A N/A t render c N/A r N/A N/A r encode utf-8 N/A N/A fd base N/A N/A tempfile mkstemp N/A tex N/A N/A os fdopen fd N/A N/A N/A tex write r N/A N/A N/A tex close N/A items N/A N/A log aux pdf dvi png split N/A names N/A dict N/A N/A x N/A %s.%s N/A base x N/A x items N/A output N/A names N/A outtype N/A N/A N/A outtype pdf N/A outtype dvi N/A N/A N/A pdflatex base outtype N/A N/A N/A outtype png N/A N/A N/A pdflatex base dvi N/A N/A call N/A dvipng -bg -transparent N/A names N/A dvi -o N/A names N/A png cwd N/A N/A N/A os path dirname base stdout PIPE stderr PIPE N/A N/A N/A os remove N/A names N/A log N/A N/A N/A os remove N/A names N/A aux N/A N/A N/A os remove base N/A N/A outfile N/A N/A o N/A N/A N/A file output read N/A N/A N/A os remove output N/A o N/A N/A N/A N/A os rename output outfile N/A pdflatex N/A N/A outfile outtype N/A pdf N/A N/A N/A dirname filename N/A N/A N/A os path split outfile N/A N/A print dirname: dirname N/A N/A print filename: filename N/A N/A N/A subprocess check_call N/A pdflatex -interaction=nonstopmode -output-format outtype filename cwd dirname N/A