# Path: djedi/compat.py
# def patterns(*urls):
#         def parse_bits(parser, bits, params, varargs, varkw, defaults,
#                        takes_context, name):
#     def generic_tag_compiler(parser, token, params, varargs, varkw, defaults,
#                              name, takes_context, node_class):
#         def __init__(self, *args, **kwargs):
#     def get_cache(name):
#     def getargspec(func):
#     class TemplateResponse(BaseTemplateResponse):
# 
# Path: djedi/rest/api.py
# class EmbedApi(View):
# 
#     def get(self, request):
#         if has_permission(request):
#             return render_embed(request=request)
#         else:
#             # We used to `raise PermissionDenied` here (which might seem more
#             # appropriate), but that has the annoying side effect of being
#             # logged as an error in the browser dev tools, making people think
#             # something is wrong.
#             return HttpResponse(status=204)
# 
# class NodesApi(APIView):
#     """
#     JSON Response:
#         {uri: content, uri: content, ...}
#     """
#     @never_cache
#     def post(self, request):
#         # Disable caching gets in CachePipe, defaults through this api is not trusted
#         cio.conf.settings.configure(
#             local=True,
#             CACHE={
#                 'PIPE': {
#                     'CACHE_ON_GET': False
#                 }
#             }
#         )
# 
#         nodes = []
#         for uri, default in six.iteritems(json.loads(request.body)):
#             node = cio.get(uri, default=default)
#             nodes.append(node)
# 
#         data = dict((node.uri, node.content) for node in nodes)
# 
#         return self.render_to_json(data)


from django.http import Http404
from ..compat import patterns, url
from .api import EmbedApi, NodesApi


app_name = 'rest'


def not_found(*args, **kwargs):
    raise Http404


urlpatterns = patterns(
    url(r'^$', not_found, name='api-base'),
    url(r'^embed/$', EmbedApi.as_view(), name='embed'),

# Path: djedi/compat.py
# def patterns(*urls):
#         def parse_bits(parser, bits, params, varargs, varkw, defaults,
#                        takes_context, name):
#     def generic_tag_compiler(parser, token, params, varargs, varkw, defaults,
#                              name, takes_context, node_class):
#         def __init__(self, *args, **kwargs):
#     def get_cache(name):
#     def getargspec(func):
#     class TemplateResponse(BaseTemplateResponse):
# 
# Path: djedi/rest/api.py
# class EmbedApi(View):
# 
#     def get(self, request):
#         if has_permission(request):
#             return render_embed(request=request)
#         else:
#             # We used to `raise PermissionDenied` here (which might seem more
#             # appropriate), but that has the annoying side effect of being
#             # logged as an error in the browser dev tools, making people think
#             # something is wrong.
#             return HttpResponse(status=204)
# 
# class NodesApi(APIView):
#     """
#     JSON Response:
#         {uri: content, uri: content, ...}
#     """
#     @never_cache
#     def post(self, request):
#         # Disable caching gets in CachePipe, defaults through this api is not trusted
#         cio.conf.settings.configure(
#             local=True,
#             CACHE={
#                 'PIPE': {
#                     'CACHE_ON_GET': False
#                 }
#             }
#         )
# 
#         nodes = []
#         for uri, default in six.iteritems(json.loads(request.body)):
#             node = cio.get(uri, default=default)
#             nodes.append(node)
# 
#         data = dict((node.uri, node.content) for node in nodes)
# 
#         return self.render_to_json(data)


# Path: djedi/rest/urls.py
from django.http import Http404
from ..compat import patterns, url
from .api import EmbedApi, NodesApi



app_name = 'rest'


def not_found(*args, **kwargs):
    raise Http404


urlpatterns = patterns(
    url(r'^$', not_found, name='api-base'),
    url(r'^embed/$', EmbedApi.as_view(), name='embed'),

    url(r'^nodes/$', NodesApi.as_view(), name='nodes'),