ImprovedTableParser

Changeset

31:43371b8d3dc1
2012-07-11 Paul Boddie raw files shortlog changelog graph Moved formatting-related functions to MoinSupport.
ImprovedTableParser.py (file)
     1.1 --- a/ImprovedTableParser.py	Sun Jun 17 20:45:00 2012 +0200
     1.2 +++ b/ImprovedTableParser.py	Wed Jul 11 00:47:30 2012 +0200
     1.3 @@ -269,34 +269,6 @@
     1.4                  table_attrs[name] = value
     1.5                  del attrs[name]
     1.6  
     1.7 -# Formatting of embedded content.
     1.8 -
     1.9 -def getFormatterClass(request, format):
    1.10 -
    1.11 -    """
    1.12 -    Return a formatter class using the 'request' for the given output 'format',
    1.13 -    returning a plain text formatter if no formatter can be found for the
    1.14 -    specified 'format'.
    1.15 -    """
    1.16 -
    1.17 -    try:
    1.18 -        return wikiutil.searchAndImportPlugin(request.cfg, "formatter", format or "plain")
    1.19 -    except wikiutil.PluginMissingError:
    1.20 -        return wikiutil.searchAndImportPlugin(request.cfg, "formatter", "plain")
    1.21 -
    1.22 -def formatText(text, request, fmt):
    1.23 -
    1.24 -    "Format the given 'text' using the specified 'request' and formatter 'fmt'."
    1.25 -
    1.26 -    parser_cls = getParserClass(request, request.page.pi["format"])
    1.27 -    parser = parser_cls(text, request, line_anchors=False)
    1.28 -    old_fmt = request.formatter
    1.29 -    request.formatter = fmt
    1.30 -    try:
    1.31 -        return redirectedOutput(request, parser, fmt, inhibit_p=True)
    1.32 -    finally:
    1.33 -        request.formatter = old_fmt
    1.34 -
    1.35  # Sorting utilities.
    1.36  
    1.37  def get_sort_columns(s, start=0):