# Path: statik/utils.py
# def add_url_path_component(path, component):
#     return '%s/%s' % (path.rstrip('/'), component.lstrip('/'))
# 
# Path: statik/templatetags.py
# class TemplateTagStore(object):
#     def __init__(self):
#     def invoke_tag(self, tag_name, context, *args, **kwargs):
#     def register_tag(self, name, fn):
#     def register_filter(self, name, fn):
#     def simple_tag(self, *args, **kwargs):
#             def decorator(fn):
#     def filter(self, *args, **kwargs):
#             def decorator(fn):


from jinja2 import nodes
from jinja2.ext import Extension
from jinja2.exceptions import TemplateSyntaxError
from statik.utils import add_url_path_component
from statik import templatetags
import lipsum
import logging
            else:
                raise TemplateSyntaxError("Missing Lorem Ipsum generator parameter: kind", lineno)

            if args[1].value not in self.GENERATORS:
                raise TemplateSyntaxError(
                    "Supported Lorem Ipsum generator kinds are: %s" % ", ".join(self.GENERATORS.keys()),
                    lineno
                )
        else:
            # if no parameters were supplied
            args = [nodes.Const(1), nodes.Const("paragraphs")]

        return nodes.Output(
            [self.call_method("_lipsum", args)],
            lineno=lineno
        )


class StatikTemplateTagsExtension(Extension):

    @property
    def tags(self):
        return set(templatetags.store.tags.keys())

    def __init__(self, environment):
        super(StatikTemplateTagsExtension, self).__init__(environment)
        self.active_tag = None
        logger.debug("Loaded custom template tags: %s", ", ".join(self.tags))

    def _invoke_tag(self, tag_name, context, *args, **kwargs):

# Path: statik/utils.py
# def add_url_path_component(path, component):
#     return '%s/%s' % (path.rstrip('/'), component.lstrip('/'))
# 
# Path: statik/templatetags.py
# class TemplateTagStore(object):
#     def __init__(self):
#     def invoke_tag(self, tag_name, context, *args, **kwargs):
#     def register_tag(self, name, fn):
#     def register_filter(self, name, fn):
#     def simple_tag(self, *args, **kwargs):
#             def decorator(fn):
#     def filter(self, *args, **kwargs):
#             def decorator(fn):


# Path: statik/jinja2ext.py
from jinja2 import nodes
from jinja2.ext import Extension
from jinja2.exceptions import TemplateSyntaxError
from statik.utils import add_url_path_component
from statik import templatetags
import lipsum
import logging

            else:
                raise TemplateSyntaxError("Missing Lorem Ipsum generator parameter: kind", lineno)

            if args[1].value not in self.GENERATORS:
                raise TemplateSyntaxError(
                    "Supported Lorem Ipsum generator kinds are: %s" % ", ".join(self.GENERATORS.keys()),
                    lineno
                )
        else:
            # if no parameters were supplied
            args = [nodes.Const(1), nodes.Const("paragraphs")]

        return nodes.Output(
            [self.call_method("_lipsum", args)],
            lineno=lineno
        )


class StatikTemplateTagsExtension(Extension):

    @property
    def tags(self):
        return set(templatetags.store.tags.keys())

    def __init__(self, environment):
        super(StatikTemplateTagsExtension, self).__init__(environment)
        self.active_tag = None
        logger.debug("Loaded custom template tags: %s", ", ".join(self.tags))

    def _invoke_tag(self, tag_name, context, *args, **kwargs):

        return templatetags.store.invoke_tag(tag_name, context, *args, **kwargs)