Luke Plant committed e8615b0

Removed some unused code.

  • Participants
  • Parent commits b2e0e15

Comments (0)

Files changed (4)

File semanticeditor/templates/semanticeditor/editorwidget.html

             symanticopts = {
-                extract_structure_url: "{% url semantic.extract_structure %}",
                 retrieve_styles_url: "{% url semantic.retrieve_styles %}",
                 retrieve_commands_url: "{% url semantic.retrieve_commands %}",
                 separate_presentation_url: "{% url semantic.separate_presentation %}",

File semanticeditor/

 from semanticeditor.views import *
 urlpatterns = patterns('',
-    url(r'extract_structure/', extract_structure_view, name="semantic.extract_structure"),
     url(r'retrieve_styles/', retrieve_styles, name="semantic.retrieve_styles"),
     url(r'retrieve_commands/', retrieve_commands, name="semantic.retrieve_commands"),
     url(r'separate_presentation/', separate_presentation, name="semantic.separate_presentation"),

File semanticeditor/utils/

     Extracts H1, H2, etc headings, and other block level elements and
     returns a list of tuples containing (level, name, tag)
-    # Parse
+    # This function is no longer used externally, but it has tests
+    # against it that are useful at checking the behaviour of get_structure
     tree = parse(content, clean=True)
     structure = get_structure(tree, assert_structure=True)
     return structure
     The dictionary has keys which are the ids of sections,
     and values which are lists of CSS classes or special commands.
-    #import pdb
-    #pdb.set_trace()
     layout_strategy = get_layout_details_strategy()
     html = layout_strategy.format_pre_parse_hacks(html, styleinfo)
     root = parse(html, clean=True)

File semanticeditor/

 from django.core.mail import mail_admins
 from django.conf import settings
 from django.utils.translation import ugettext as _
-from semanticeditor.utils import extract_structure, extract_presentation, format_html, preview_html, AllUserErrors, COMMANDS, PresentationInfo, PresentationClass, clean_html
+from semanticeditor.utils import extract_presentation, format_html, preview_html, AllUserErrors, COMMANDS, PresentationInfo, PresentationClass, clean_html
 from semanticeditor.models import CssClass
 import sys
         return failure(e.args[0])
     return success(val)
-def SI_to_dict(si):
-    """
-    Convert a StructureItem to dictionary for use client side
-    """
-    return dict((k,v) for k,v in si.__dict__.items() if k != 'node')
-def extract_structure_view(request):
-    data = request.POST.get('html','')
-    def _handled():
-        return map(SI_to_dict, extract_structure(data))
-    return graceful_errors(AllUserErrors, _handled)
 def PI_to_dict(pi):
     Converts a PresentationInfo to a dictionary