diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-04-16 10:44:33 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-04-16 10:44:33 -0700 |
commit | 9dcbd210f76714e9ccf9426e4c78726a8a3ba76e (patch) | |
tree | dd86bc572987923acb6010882b94fd3936f328d2 /news.py | |
parent | 00a5112f81575e1052bf0f8251953e91a265f824 (diff) | |
download | tools-9dcbd210f76714e9ccf9426e4c78726a8a3ba76e.tar.gz tools-9dcbd210f76714e9ccf9426e4c78726a8a3ba76e.tar.bz2 tools-9dcbd210f76714e9ccf9426e4c78726a8a3ba76e.tar.xz tools-9dcbd210f76714e9ccf9426e4c78726a8a3ba76e.zip |
Add a phpbb forum backend to the news generator
Diffstat (limited to 'news.py')
-rwxr-xr-x | news.py | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -79,9 +79,24 @@ class TxtWriter(BasicWriter): #self.stream.write('Did you really read down this far?\n') pass +class ForumWriter(BasicWriter): + # unlike the other writers, the forum writer only generates the latest + __slots__ = ('done') + def start(self): + self.done = False + def put(self, entry): + if self.done: + return + entry = entry.format(**colors.make_forum_colors_dict()) + self.stream.write(entry) + self.done = True + def finish(self): + pass + def create_writers(outdir): yield TxtWriter(os.path.join(outdir, 'news.txt')) yield HtmlWriter(os.path.join(outdir, 'news.html')) + yield ForumWriter(os.path.join(outdir, 'news.phpbb.txt')) def main(outdir, indir=None): if indir is None: |