# 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



logger = logging.getLogger(__name__)

__all__ = [
    'StatikUrlExtension',
    'StatikAssetExtension',
    'StatikTemplateTagsExtension',
    'StatikLoremIpsumExtension'
]


class StatikUrlExtension(Extension):
    """Provides the `{% url %}` extension for reverse-location of URLs from views/data."""

    tags = {'url'}

    def __init__(self, environment):
        super(StatikUrlExtension, self).__init__(environment)

        environment.extend(
            statik_views={},
            statik_base_url=''
        )

    def _url(self, view_name, inst):
        views = self.environment.statik_views
        if view_name not in views:
            raise KeyError("Unrecognised view: \"%s\"" % view_name)

# 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




logger = logging.getLogger(__name__)

__all__ = [
    'StatikUrlExtension',
    'StatikAssetExtension',
    'StatikTemplateTagsExtension',
    'StatikLoremIpsumExtension'
]


class StatikUrlExtension(Extension):
    """Provides the `{% url %}` extension for reverse-location of URLs from views/data."""

    tags = {'url'}

    def __init__(self, environment):
        super(StatikUrlExtension, self).__init__(environment)

        environment.extend(
            statik_views={},
            statik_base_url=''
        )

    def _url(self, view_name, inst):
        views = self.environment.statik_views
        if view_name not in views:
            raise KeyError("Unrecognised view: \"%s\"" % view_name)

        return add_url_path_component(