1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/parsers/table.py Sun Jan 15 23:37:14 2012 +0100
1.3 @@ -0,0 +1,43 @@
1.4 +# -*- coding: iso-8859-1 -*-
1.5 +"""
1.6 + MoinMoin - table (ImprovedTableParser)
1.7 +
1.8 + @copyright: 2012 by Paul Boddie <paul@boddie.org.uk>
1.9 + @license: GNU GPL (v2 or later), see COPYING.txt for details.
1.10 +"""
1.11 +
1.12 +from ImprovedTableParser import *
1.13 +
1.14 +Dependencies = ["pages"]
1.15 +
1.16 +# Parser support.
1.17 +
1.18 +class Parser:
1.19 +
1.20 + "Support a more flexible table syntax."
1.21 +
1.22 + Dependencies = Dependencies
1.23 + extensions = []
1.24 +
1.25 + def __init__(self, raw, request, **kw):
1.26 +
1.27 + """
1.28 + Initialise the parser with the given 'raw' data, 'request' and any
1.29 + keyword arguments that may have been supplied.
1.30 + """
1.31 +
1.32 + self.raw = raw
1.33 + self.request = request
1.34 + self.attrs = parseAttributes(kw.get("format_args", ""), False)
1.35 +
1.36 + def format(self, fmt):
1.37 +
1.38 + "Format a table using the given formatter 'fmt'."
1.39 +
1.40 + request = self.request
1.41 + page = request.page
1.42 + _ = request.getText
1.43 +
1.44 + formatTable(self.raw, request, fmt)
1.45 +
1.46 +# vim: tabstop=4 expandtab shiftwidth=4