Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2010-09-10 21:50:38 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2010-09-10 21:50:38 (GMT)
commit4d8f60e868daa7343b0c13a22cbdbabe3b55211d (patch)
tree4a5a6871919cf21d062cc0076a6a441ea9066baa
parent72cdcb42ebbb910b38758f4656cf1aceb6bca9d5 (diff)
Remove logging to let MyLogger handle all logs
-rw-r--r--css-minutes-default.css3
-rw-r--r--meeting.py49
-rw-r--r--tests/run_test.py44
-rw-r--r--writers.py2
4 files changed, 24 insertions, 74 deletions
diff --git a/css-minutes-default.css b/css-minutes-default.css
index c383b14..5b74f10 100644
--- a/css-minutes-default.css
+++ b/css-minutes-default.css
@@ -1,7 +1,5 @@
/* This is for the .html in the HTML2 writer */
body {
- font-family: Helvetica, sans-serif;
- font-size:14px;
}
h1 {
text-align: center;
@@ -21,7 +19,6 @@ hr {
}
/* The (nick, time) item pairs, and other body text things. */
.details {
- font-size: 12px;
font-weight:bold;
}
/* The 'AGREED:', 'IDEA', etc, prefix to lines. */
diff --git a/meeting.py b/meeting.py
index 9a11c9f..4285dd8 100644
--- a/meeting.py
+++ b/meeting.py
@@ -55,7 +55,6 @@ class Config(object):
# channel. This will be sent through strftime for substituting it
# times, howover, for strftime codes you must use doubled percent
# signs (%%). This will be joined with the directories above.
- filenamePattern = '%(channel)s/%%Y/%(channel)s.%%F-%%H.%%M'
# Where to say to go for more information about MeetBot
MeetBotInfoURL = 'http://wiki.debian.org/MeetBot'
# This is used with the #restrict command to remove permissions from files.
@@ -68,30 +67,12 @@ class Config(object):
command_RE = re.compile(r'#([\w]+)[ \t]*(.*)')
# The channels which won't have date/time appended to the filename.
specialChannels = ("#meetbot-test", "#meetbot-test2")
- specialChannelFilenamePattern = '%(channel)s/%(channel)s'
# HTML irc log highlighting style. `pygmentize -L styles` to list.
pygmentizeStyle = 'friendly'
# Timezone setting. You can use friendly names like 'US/Eastern', etc.
# Check /usr/share/zoneinfo/ . Or `man timezone`: this is the contents
# of the TZ environment variable.
timeZone = 'UTC'
- # These are the start and end meeting messages, respectively.
- # Some replacements are done before they are used, using the
- # %(name)s syntax. Note that since one replacement is done below,
- # you have to use doubled percent signs. Also, it gets split by
- # '\n' and each part between newlines get said in a separate IRC
- # message.
- startMeetingMessage = ("Meeting started %(starttime)s %(timeZone)s. "
- "The chair is %(chair)s. Information about MeetBot at "
- "%(MeetBotInfoURL)s.\n"
- "Useful Commands: #action #agreed #help #info #idea #link "
- "#topic.")
- endMeetingMessage = ("Meeting ended %(endtime)s %(timeZone)s. "
- "Information about MeetBot at %(MeetBotInfoURL)s . "
- "(v %(__version__)s)\n"
- "Minutes: %(urlBasename)s.html\n"
- "Minutes (text): %(urlBasename)s.txt\n"
- "Log: %(urlBasename)s.log.html")
# Input/output codecs.
input_codec = 'utf-8'
output_codec = 'utf-8'
@@ -100,22 +81,13 @@ class Config(object):
return text.encode(self.output_codec, 'replace')
def dec(self, text):
return text.decode(self.input_codec, 'replace')
- # Write out select logfiles
- update_realtime = True
# CSS configs:
- cssFile_log = 'default'
- cssEmbed_log = True
cssFile_minutes = 'default'
cssEmbed_minutes = True
# This tells which writers write out which to extensions.
writer_map = {
- '.log.html':writers.HTMLlog,
- #'.1.html': writers.HTML,
'.html': writers.HTML2,
- #'.rst': writers.ReST,
- '.txt': writers.Text,
- #'.rst.html':writers.HTMLfromReST,
}
@@ -129,8 +101,6 @@ class Config(object):
if hasattr(self, "init_hook"):
self.init_hook()
- if writeRawLog:
- self.writers['.log.txt'] = writers.TextLog(self.M)
for extension, writer in self.writer_map.iteritems():
self.writers[extension] = writer(self.M)
self.safeMode = safeMode
@@ -143,10 +113,7 @@ class Config(object):
# names useful for pathname formatting.
# Certain test channels always get the same name - don't need
# file prolifiration for them
- if self.M.channel in self.specialChannels:
- pattern = self.specialChannelFilenamePattern
- else:
- pattern = self.filenamePattern
+ pattern = '%(channel)s/%%Y-%%m-%%dT%%H:%%M:%%S'
channel = self.M.channel.strip('# ').lower().replace('/', '')
network = self.M.network.strip(' ').lower().replace('/', '')
if self.M._meetingname:
@@ -269,7 +236,12 @@ class MeetingCommands(object):
"""Begin a meeting."""
self.starttime = time_
repl = self.replacements()
- message = self.config.startMeetingMessage%repl
+ startMeetingMessage = ("Meeting started %(starttime)s %(timeZone)s. "
+ "The chair is %(chair)s. Information about MeetBot at "
+ "%(MeetBotInfoURL)s.\n"
+ "Useful Commands: #action #agreed #help #info #idea #link "
+ "#topic #endmeeting")
+ message = startMeetingMessage%repl
for messageline in message.split('\n'):
self.reply(messageline)
if line.strip():
@@ -282,7 +254,12 @@ class MeetingCommands(object):
self.endtime = time_
self.config.save()
repl = self.replacements()
- message = self.config.endMeetingMessage%repl
+ endMeetingMessage = ("Meeting ended %(endtime)s %(timeZone)s. "
+ "Information about MeetBot at %(MeetBotInfoURL)s. "
+ "(v %(__version__)s)\n"
+ "Minutes: %(urlBasename)s.html\n"
+ "Log: %(urlBasename)s")
+ message = endMeetingMessage%repl
for messageline in message.split('\n'):
self.reply(messageline)
self._meetingIsOver = True
diff --git a/tests/run_test.py b/tests/run_test.py
index 07aecdf..5fdbc7e 100644
--- a/tests/run_test.py
+++ b/tests/run_test.py
@@ -170,81 +170,57 @@ class MeetBotTest(unittest.TestCase):
results = self.M_trivial(extraConfig={}).save()
self.assert_('<link rel="stylesheet" ' not in results['.html'])
self.assert_('body {' in results['.html'])
- self.assert_('<link rel="stylesheet" ' not in results['.log.html'])
- self.assert_('body {' in results['.log.html'])
def test_css_noembed(self):
- extraConfig={'cssEmbed_minutes':False,
- 'cssEmbed_log':False,}
+ extraConfig={'cssEmbed_minutes':False}
M = self.M_trivial(extraConfig=extraConfig)
results = M.save()
self.assert_('<link rel="stylesheet" ' in results['.html'])
self.assert_('body {' not in results['.html'])
- self.assert_('<link rel="stylesheet" ' in results['.log.html'])
- self.assert_('body {' not in results['.log.html'])
def test_css_file(self):
tmpf = tempfile.NamedTemporaryFile()
magic_string = '546uorck6o45tuo6'
tmpf.write(magic_string)
tmpf.flush()
- extraConfig={'cssFile_minutes': tmpf.name,
- 'cssFile_log': tmpf.name,}
+ extraConfig={'cssFile_minutes': tmpf.name}
M = self.M_trivial(extraConfig=extraConfig)
results = M.save()
self.assert_('<link rel="stylesheet" ' not in results['.html'])
self.assert_(magic_string in results['.html'])
- self.assert_('<link rel="stylesheet" ' not in results['.log.html'])
- self.assert_(magic_string in results['.log.html'])
def test_css_file_embed(self):
tmpf = tempfile.NamedTemporaryFile()
magic_string = '546uorck6o45tuo6'
tmpf.write(magic_string)
tmpf.flush()
extraConfig={'cssFile_minutes': tmpf.name,
- 'cssFile_log': tmpf.name,
- 'cssEmbed_minutes': False,
- 'cssEmbed_log': False,}
+ 'cssEmbed_minutes': False}
M = self.M_trivial(extraConfig=extraConfig)
results = M.save()
self.assert_('<link rel="stylesheet" ' in results['.html'])
self.assert_(tmpf.name in results['.html'])
- self.assert_('<link rel="stylesheet" ' in results['.log.html'])
- self.assert_(tmpf.name in results['.log.html'])
def test_css_none(self):
tmpf = tempfile.NamedTemporaryFile()
magic_string = '546uorck6o45tuo6'
tmpf.write(magic_string)
tmpf.flush()
- extraConfig={'cssFile_minutes': 'none',
- 'cssFile_log': 'none',}
+ extraConfig={'cssFile_minutes': 'none'}
M = self.M_trivial(extraConfig=extraConfig)
results = M.save()
self.assert_('<link rel="stylesheet" ' not in results['.html'])
self.assert_('<style type="text/css" ' not in results['.html'])
- self.assert_('<link rel="stylesheet" ' not in results['.log.html'])
- self.assert_('<style type="text/css" ' not in results['.log.html'])
def test_filenamevars(self):
- def getM(fnamepattern):
+ def getM():
M = meeting.Meeting(channel='somechannel',
network='somenetwork',
- owner='nobody',
- extraConfig={'filenamePattern':fnamepattern})
+ owner='nobody')
M.addline('nobody', '#startmeeting')
return M
- # Test the %(channel)s and %(network)s commands in supybot.
- M = getM('%(channel)s-%(network)s')
- assert M.config.filename().endswith('somechannel-somenetwork'), \
- "Filename not as expected: "+M.config.filename()
# Test dates in filenames
- M = getM('%(channel)s-%%F')
+ M = getM()
import time
- assert M.config.filename().endswith(time.strftime('somechannel-%F')),\
- "Filename not as expected: "+M.config.filename()
- # Test #meetingname in filenames
- M = getM('%(channel)s-%(meetingname)s')
- M.addline('nobody', '#meetingname blah1234')
- assert M.config.filename().endswith('somechannel-blah1234'),\
- "Filename not as expected: "+M.config.filename()
+ assert M.config.filename().endswith(time.strftime(
+ 'somechannel/%Y-%m-%dT%H:%M:%S', M.starttime)),\
+ "Filename not as expected: "+M.config.filename()
if __name__ == '__main__':
diff --git a/writers.py b/writers.py
index 7a6738b..2062e44 100644
--- a/writers.py
+++ b/writers.py
@@ -106,7 +106,7 @@ class _BaseWriter(object):
'starttime':time.strftime("%H:%M:%S", self.M.starttime),
'endtime':time.strftime("%H:%M:%S", self.M.endtime),
'timeZone':self.M.config.timeZone,
- 'fullLogs':self.M.config.basename+'.log.html',
+ 'fullLogs':self.M.config.basename,
'fullLogsFullURL':self.M.config.filename(url=True)+'.log.html',
'MeetBotInfoURL':self.M.config.MeetBotInfoURL,
'MeetBotVersion':MeetBotVersion(),