# Path: contentious/api.py
# class ContentiousInterface(object):
#     def in_edit_mode(self, template_context):
#     def get_content_data(self, key, template_context):
#     def save_content_data(self, key, data, template_context):
#     def pre_render(self, tag_spec, meta):
# def get_api():
# 
# Path: contentious/constants.py
# SELF_CLOSING_HTML_TAGS = ['img', 'br', 'hr', 'meta']
# 
# TREAT_CONTENT_AS_HTML_TAGS = getattr(settings,
#     'CONTENTIOUS_TREAT_CONTENT_AS_HTML_TAGS', ['div', 'select', 'ul'])


import logging
import re
from django import template
from django.template import loader, TemplateSyntaxError
from django.utils.html import escape
from ..api import api
from ..constants import (
    SELF_CLOSING_HTML_TAGS,
    TREAT_CONTENT_AS_HTML_TAGS,
)
        self.editables = editables
        self.optionals = optionals
        self.attrs = attrs
        self.nodelist = nodelist
        self.extra = extra

    def render(self, context, is_nested=False):
        """ Render the HTML tag for the page.
            This will contain all of the edited items (attributes and content),
            with the defaults used for ones which have not been edited.  In
            edit mode we also add lots of data-x attributes for the JS.
        """
        #Note, we should not modifiy the properties of self in here, hence variables
        #from the context are resolved into new variables, not the properties
        key = self.key.resolve(context)
        attrs = {k: v.resolve(context) for k, v in self.attrs.items()}
        editables = self.editables.resolve(context)
        optionals = self.optionals.resolve(context) if self.optionals else []
        extra = self.extra.resolve(context) if self.extra else None

        assert not ('content' in editables and EditableTag in [type(t) for t in self.nodelist]), "Cannot edit content if editable contains nested editables"

        if isinstance(editables, basestring):
            #Allow editables to be passed in as either a comma-separated string or
            #an interable
            editables = [x for x in editables.split(",") if x]

        if isinstance(optionals, basestring):
            optionals = [x for x in optionals.split(",") if x]


# Path: contentious/api.py
# class ContentiousInterface(object):
#     def in_edit_mode(self, template_context):
#     def get_content_data(self, key, template_context):
#     def save_content_data(self, key, data, template_context):
#     def pre_render(self, tag_spec, meta):
# def get_api():
# 
# Path: contentious/constants.py
# SELF_CLOSING_HTML_TAGS = ['img', 'br', 'hr', 'meta']
# 
# TREAT_CONTENT_AS_HTML_TAGS = getattr(settings,
#     'CONTENTIOUS_TREAT_CONTENT_AS_HTML_TAGS', ['div', 'select', 'ul'])


# Path: contentious/templatetags/contentious.py
import logging
import re
from django import template
from django.template import loader, TemplateSyntaxError
from django.utils.html import escape
from ..api import api
from ..constants import (
    SELF_CLOSING_HTML_TAGS,
    TREAT_CONTENT_AS_HTML_TAGS,
)

        self.editables = editables
        self.optionals = optionals
        self.attrs = attrs
        self.nodelist = nodelist
        self.extra = extra

    def render(self, context, is_nested=False):
        """ Render the HTML tag for the page.
            This will contain all of the edited items (attributes and content),
            with the defaults used for ones which have not been edited.  In
            edit mode we also add lots of data-x attributes for the JS.
        """
        #Note, we should not modifiy the properties of self in here, hence variables
        #from the context are resolved into new variables, not the properties
        key = self.key.resolve(context)
        attrs = {k: v.resolve(context) for k, v in self.attrs.items()}
        editables = self.editables.resolve(context)
        optionals = self.optionals.resolve(context) if self.optionals else []
        extra = self.extra.resolve(context) if self.extra else None

        assert not ('content' in editables and EditableTag in [type(t) for t in self.nodelist]), "Cannot edit content if editable contains nested editables"

        if isinstance(editables, basestring):
            #Allow editables to be passed in as either a comma-separated string or
            #an interable
            editables = [x for x in editables.split(",") if x]

        if isinstance(optionals, basestring):
            optionals = [x for x in optionals.split(",") if x]


        edit_mode = api.in_edit_mode(context)