Reformatted with automated tools and minor fixes.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
"""Define a Jinja2 Processor which applies programmable templating to the input stream."""
|
||||
|
||||
from typing import Iterable, Optional, Dict, cast
|
||||
from typing import Dict, Iterable, Optional, cast
|
||||
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
@ -22,7 +22,7 @@ class Jinja2(PassThrough):
|
||||
iterable: The post-processed output stream
|
||||
"""
|
||||
ctx = cast(Dict, ctx)
|
||||
template_env = Environment(loader=FileSystemLoader(ctx["templates"]), extensions=['jinja2.ext.do'])
|
||||
template_env = Environment(loader=FileSystemLoader(ctx["templates"]), extensions=["jinja2.ext.do"])
|
||||
template_env.globals.update(ctx["globals"])
|
||||
template_env.filters.update(ctx["filters"])
|
||||
tmpl = template_env.from_string("".join([x for x in input_file]))
|
||||
|
@ -3,8 +3,7 @@
|
||||
the target template is rendered)."""
|
||||
|
||||
import os
|
||||
|
||||
from typing import Iterable, Optional, Dict, cast
|
||||
from typing import Dict, Iterable, Optional, cast
|
||||
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
@ -52,7 +51,7 @@ class Jinja2PageEmbed(Processor):
|
||||
iterable: The post-processed output stream
|
||||
"""
|
||||
ctx = cast(Dict, ctx)
|
||||
template_env = Environment(loader=FileSystemLoader(ctx["templates"]), extensions=['jinja2.ext.do'])
|
||||
template_env = Environment(loader=FileSystemLoader(ctx["templates"]), extensions=["jinja2.ext.do"])
|
||||
template_env.globals.update(ctx["globals"])
|
||||
template_env.filters.update(ctx["filters"])
|
||||
tmpl = template_env.get_template(ctx["template"])
|
||||
|
@ -1,10 +1,10 @@
|
||||
"""Passthrough progcessor which takes input and returns it."""
|
||||
|
||||
import os
|
||||
from typing import Dict, Iterable, Optional, cast
|
||||
|
||||
from .processors import Processor, PassthroughException
|
||||
from ..utils import guess_mime
|
||||
from typing import Iterable, Optional, Dict, cast
|
||||
from .processors import PassthroughException, Processor
|
||||
|
||||
|
||||
class PassThrough(Processor):
|
||||
|
@ -2,8 +2,7 @@
|
||||
|
||||
import io
|
||||
import os
|
||||
|
||||
from typing import Iterable, Optional, Dict
|
||||
from typing import Dict, Iterable, Optional
|
||||
|
||||
import markdown
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
import abc
|
||||
|
||||
from typing import Iterable, Optional, Dict
|
||||
from typing import Dict, Iterable, Optional
|
||||
|
||||
|
||||
class PassthroughException(Exception):
|
||||
|
Reference in New Issue
Block a user