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-01 22:43:38 (GMT)
committer Richard Darst <rkd@zgib.net>2009-07-01 22:43:38 (GMT)
commit975f334b7cf1ab36c1bdb0d05b33c9b06cb39e71 (patch)
tree87ae91b6c6dc005f35dddd09c2513be4d99cdfd6 /writers.py
parente2d92d2486678005213332b5b9aa0fb869b51706 (diff)
Change format of writer_map
- we don't store already-instantiated classes in writer_map. The writers are now instantiated with the meeting object as the argument. darcs-hash:20090701224338-82ea9-1abfb53173ce382764868b6c57a5b2929b36a991.gz
Diffstat (limited to 'writers.py')
-rw-r--r--writers.py33
1 files changed, 18 insertions, 15 deletions
diff --git a/writers.py b/writers.py
index 57cf7b0..8ea62b6 100644
--- a/writers.py
+++ b/writers.py
@@ -19,17 +19,20 @@ def rst(text):
return text
class _BaseWriter(object):
- pass
+ def __init__(self, M):
+ self.M = M
-class TextLog(object):
- def format(self, M):
+class TextLog(_BaseWriter):
+ def format(self):
+ M = self.M
"""Write raw text logs."""
return "\n".join(M.lines)
-class HTMLlog(object):
- def format(self, M):
+class HTMLlog(_BaseWriter):
+ def format(self):
"""Write pretty HTML logs."""
+ M = self.M
# pygments lexing setup:
# (pygments HTML-formatter handles HTML-escaping)
import pygments
@@ -57,9 +60,10 @@ class HTMLlog(object):
return out
-class HTML(object):
- def format(self, M):
+class HTML(_BaseWriter):
+ def format(self):
"""Write the minutes summary."""
+ M = self.M
data = [ ]
if M._meetingTopic:
pageTitle = "%s: %s"%(M.channel, M._meetingTopic)
@@ -145,12 +149,10 @@ class HTML(object):
return "\n".join(data)
-class RST(object):
- def __init__(self):
- pass
-
- def format(self, M):
+class RST(_BaseWriter):
+ def format(self):
"""Return a ReStructured Text minutes summary."""
+ M = self.M
dedent = textwrap.dedent
wrap = textwrap.wrap
fill = textwrap.fill
@@ -307,11 +309,12 @@ class RST(object):
#osys.exit()
return body
-class HTMLfromRST(object):
+class HTMLfromRST(_BaseWriter):
- def format(self, M):
+ def format(self):
+ M = self.M
import docutils.core
- rst = RST().format(M)
+ rst = RST(M).format()
rstToHTML = docutils.core.publish_string(rst, writer_name='html',
settings_overrides={'file_insertion_enabled': 0,
'raw_enabled': 0})