# HG changeset patch # User Paul Boddie # Date 1389713761 -3600 # Node ID deac532a14c0304855b170cf85cc801e9b6cadca # Parent c658afe0a49447e2b7a507f3b8758a4e0698641f Added a "raw" parser which just formats its input as text. diff -r c658afe0a494 -r deac532a14c0 MoinSupport.py --- a/MoinSupport.py Thu Jan 09 22:56:28 2014 +0100 +++ b/MoinSupport.py Tue Jan 14 16:36:01 2014 +0100 @@ -2,7 +2,7 @@ """ MoinMoin - MoinSupport library (derived from EventAggregatorSupport) - @copyright: 2008, 2009, 2010, 2011, 2012, 2013 by Paul Boddie + @copyright: 2008, 2009, 2010, 2011, 2012, 2013, 2014 by Paul Boddie @copyright: 2000-2004 Juergen Hermann 2004 by Florian Festi 2006 by Mikko Virkkil @@ -916,6 +916,17 @@ buf.close() return unicode(text, "utf-8") +class RawParser: + + "A parser that just formats everything as text." + + def __init__(self, raw, request, **kw): + self.raw = raw + self.request = request + + def format(self, fmt, write=None): + (write or self.request.write)(fmt.text(self.raw)) + # Finding components for content types. def getParsersForContentType(cfg, mimetype): diff -r c658afe0a494 -r deac532a14c0 README.txt --- a/README.txt Thu Jan 09 22:56:28 2014 +0100 +++ b/README.txt Tue Jan 14 16:36:01 2014 +0100 @@ -72,6 +72,7 @@ * Added the TokenSupport module to try and have a reliable shell-like tokeniser. * Added RFC 2822 datetime formatting. + * Added a "raw" parser which just formats its input as text. New in MoinSupport 0.4.1 (Changes since MoinSupport 0.4) --------------------------------------------------------