Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/writers.py
diff options
context:
space:
mode:
authorRichard Darst <rkd@zgib.net>2009-07-06 23:31:13 (GMT)
committer Richard Darst <rkd@zgib.net>2009-07-06 23:31:13 (GMT)
commit9db165ab72d1af47996a9f9d2d4e0163517d7ed8 (patch)
treee8a63dd535abaf65794500f10237dc776d23f778 /writers.py
parent30e9dea7c2908b04885eb1a42d4815927e1fa6cc (diff)
Some updates to names and semantics of writers
- RST -> ReST - add the argument "extension darcs-hash:20090706233113-82ea9-f3b6b93a72b939881be3bdb7be14f65f2b5a2ed3.gz
Diffstat (limited to 'writers.py')
-rw-r--r--writers.py28
1 files changed, 20 insertions, 8 deletions
diff --git a/writers.py b/writers.py
index e97524f..e6d7a8e 100644
--- a/writers.py
+++ b/writers.py
@@ -39,6 +39,18 @@ class _BaseWriter(object):
def __init__(self, M):
self.M = M
+ def format(self, extension=None):
+ """Override this method to implement the formatting.
+
+ For file output writers, the method should return a unicode
+ object containing the contents of the file to write.
+
+ The argument 'extension' is the key from `writer_map`. For
+ file writers, this can (and should) be ignored. For non-file
+ outputs, this can be used to This can be used to pass data,
+ """
+ raise NotImplementedError
+
@property
def pagetitle(self):
if self.M._meetingTopic:
@@ -77,14 +89,14 @@ class _BaseWriter(object):
class TextLog(_BaseWriter):
- def format(self):
+ def format(self, extension=None):
M = self.M
"""Write raw text logs."""
return "\n".join(M.lines)
class HTMLlog(_BaseWriter):
- def format(self):
+ def format(self, extension=None):
"""Write pretty HTML logs."""
M = self.M
# pygments lexing setup:
@@ -153,7 +165,7 @@ class HTML(_BaseWriter):
</body></html>
''')
- def format(self):
+ def format(self, extension=None):
"""Write the minutes summary."""
M = self.M
@@ -213,7 +225,7 @@ class HTML(_BaseWriter):
return body
-class RST(_BaseWriter):
+class ReST(_BaseWriter):
body = textwrap.dedent("""\
%(titleBlock)s
@@ -263,7 +275,7 @@ class RST(_BaseWriter):
.. _`MeetBot`: %(MeetBotInfoURL)s
""")
- def format(self):
+ def format(self, extension=None):
"""Return a ReStructured Text minutes summary."""
M = self.M
@@ -339,12 +351,12 @@ class RST(_BaseWriter):
body = body%repl
return body
-class HTMLfromRST(_BaseWriter):
+class HTMLfromReST(_BaseWriter):
- def format(self):
+ def format(self, extension=None):
M = self.M
import docutils.core
- rst = RST(M).format()
+ rst = ReST(M).format(extension)
rstToHTML = docutils.core.publish_string(rst, writer_name='html',
settings_overrides={'file_insertion_enabled': 0,
'raw_enabled': 0,