diff options
author | Richard Darst <rkd@zgib.net> | 2009-08-01 00:38:26 (GMT) |
---|---|---|
committer | Richard Darst <rkd@zgib.net> | 2009-08-01 00:38:26 (GMT) |
commit | 48940a3200faae1f8947f2ea5be0f85ac6379fb1 (patch) | |
tree | 8a469388df7c5362ca1c8a69a0ab44b1ed260d50 /writers.py | |
parent | adacd645f987d2837ad00b3928f3678c49a2fe2a (diff) |
First effort at realtime updating of log files
- With this change, the .log.txt is updated after every said line, so
that people can catch up to the meeting.
- This is a general mechanism, but not the most efficient for this task:
It re-opens the file after every line. This isn't ideal, but was
easiest to integrate. There are other considerations, such as the
fact that filenames can change during the meeting (#meetingname command)
or file permissions change (#restrictlogs). I still need to work out
how to deal with these issues...
darcs-hash:20090801003826-82ea9-fddfe6f61bf11ccce94fd80f6f66f3ffbe5fc9f7.gz
Diffstat (limited to 'writers.py')
-rw-r--r-- | writers.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -69,8 +69,9 @@ def replaceWRAP(item): class _BaseWriter(object): - def __init__(self, M): + def __init__(self, M, save_file=None, **kwargs): self.M = M + self.save_file = save_file def format(self, extension=None): """Override this method to implement the formatting. @@ -126,6 +127,9 @@ class TextLog(_BaseWriter): M = self.M """Write raw text logs.""" return "\n".join(M.lines) + def addline(self, line): + self.save_file(self.format()) + class HTMLlog(_BaseWriter): |