Merge lp:~lderan/ubuntu-bots/meeetingology-output into lp:~ubuntu-bots/ubuntu-bots/meetingology

Proposed by Thomas Molloy
Status: Merged
Merged at revision: 12
Proposed branch: lp:~lderan/ubuntu-bots/meeetingology-output
Merge into: lp:~ubuntu-bots/ubuntu-bots/meetingology
Diff against target: 274 lines (+55/-26)
5 files modified
items.py (+7/-7)
meeting.py (+25/-3)
meetingLocalConfig.py (+1/-1)
plugin.py (+2/-2)
writers.py (+20/-13)
To merge this branch: bzr merge lp:~lderan/ubuntu-bots/meeetingology-output
Reviewer Review Type Date Requested Status
Alan Bell Approve
Review via email: mp+164589@code.launchpad.net

Description of the change

Formatting the output for the MoinMoin wikis.
Adding votes to the top of the meeting information with results

To post a comment you must log in.
Revision history for this message
Alan Bell (alanbell) wrote :

diff looks good, seems to work

review: Approve
12. By Alan Bell

incorporating merge from lderan

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'items.py'
--- items.py 2010-09-02 19:16:45 +0000
+++ items.py 2013-05-18 11:54:26 +0000
@@ -128,7 +128,7 @@
128 text_template = """%(starttext)s%(topic)s%(endtext)s (%(nick)s, %(time)s)"""128 text_template = """%(starttext)s%(topic)s%(endtext)s (%(nick)s, %(time)s)"""
129 mw_template = """%(startmw)s%(topic)s%(endmw)s (%(nick)s, %(time)s)"""129 mw_template = """%(startmw)s%(topic)s%(endmw)s (%(nick)s, %(time)s)"""
130 moin_template = """%(startmoin)s%(topic)s%(endmoin)s (%(nick)s, %(time)s)"""130 moin_template = """%(startmoin)s%(topic)s%(endmoin)s (%(nick)s, %(time)s)"""
131 moin_template = """ *%(topic)s"""131 moin_template = """=== %(topic)s ===\nThe discussion about \"%(topic)s\" started at %(time)s.\n"""
132132
133 startrst = '**'133 startrst = '**'
134 endrst = '**'134 endrst = '**'
@@ -140,7 +140,7 @@
140 endmoin = ''140 endmoin = ''
141 def __init__(self, nick, line, linenum, time_):141 def __init__(self, nick, line, linenum, time_):
142 self.nick = nick ; self.topic = line ; self.linenum = linenum142 self.nick = nick ; self.topic = line ; self.linenum = linenum
143 self.time = time.strftime("%H:%M:%S", time_)143 self.time = time.strftime("%H:%M", time_)
144 def _htmlrepl(self, M):144 def _htmlrepl(self, M):
145 repl = self.get_replacements(M, escapewith=writers.html)145 repl = self.get_replacements(M, escapewith=writers.html)
146 repl['link'] = self.logURL(M)146 repl['link'] = self.logURL(M)
@@ -186,7 +186,7 @@
186 moin_template = """''%(itemtype)s:'' %(startmw)s%(line)s%(endmw)s (%(nick)s, %(time)s)"""186 moin_template = """''%(itemtype)s:'' %(startmw)s%(line)s%(endmw)s (%(nick)s, %(time)s)"""
187 def __init__(self, nick, line, linenum, time_):187 def __init__(self, nick, line, linenum, time_):
188 self.nick = nick ; self.line = line ; self.linenum = linenum188 self.nick = nick ; self.line = line ; self.linenum = linenum
189 self.time = time.strftime("%H:%M:%S", time_)189 self.time = time.strftime("%H:%M", time_)
190 def _htmlrepl(self, M):190 def _htmlrepl(self, M):
191 repl = self.get_replacements(M, escapewith=writers.html)191 repl = self.get_replacements(M, escapewith=writers.html)
192 repl['link'] = self.logURL(M)192 repl['link'] = self.logURL(M)
@@ -211,7 +211,6 @@
211 repl = self.get_replacements(M, escapewith=writers.moin)211 repl = self.get_replacements(M, escapewith=writers.moin)
212 return self.moin_template%repl212 return self.moin_template%repl
213213
214
215class Info(GenericItem):214class Info(GenericItem):
216 itemtype = 'INFO'215 itemtype = 'INFO'
217 html2_template = ("""<span class="%(itemtype)s">"""216 html2_template = ("""<span class="%(itemtype)s">"""
@@ -223,16 +222,17 @@
223 rst_template = """%(startrst)s%(line)s%(endrst)s (%(rstref)s_)"""222 rst_template = """%(startrst)s%(line)s%(endrst)s (%(rstref)s_)"""
224 text_template = """%(starttext)s%(line)s%(endtext)s (%(nick)s, %(time)s)"""223 text_template = """%(starttext)s%(line)s%(endtext)s (%(nick)s, %(time)s)"""
225 mw_template = """%(startmw)s%(line)s%(endmw)s (%(nick)s, %(time)s)"""224 mw_template = """%(startmw)s%(line)s%(endmw)s (%(nick)s, %(time)s)"""
226 moin_template = """%(startmoin)s%(line)s%(endmoin)s (%(nick)s, %(time)s)"""225 moin_template = """%(startmoin)s%(line)s%(endmoin)s"""
227class Idea(GenericItem):226class Idea(GenericItem):
228 itemtype = 'IDEA'227 itemtype = 'IDEA'
229class Agreed(GenericItem):228class Agreed(GenericItem):
230 itemtype = 'AGREED'229 itemtype = 'AGREED'
231class Action(GenericItem):230class Action(GenericItem):
232 itemtype = 'ACTION'231 itemtype = 'ACTION'
232 moin_template = """''ACTION:'' %(line)s"""
233class Subtopic(GenericItem):233class Subtopic(GenericItem):
234 itemtype = 'SUBTOPIC'234 itemtype = 'SUBTOPIC'
235 moin_template = """ *%(line)s (%(nick)s, %(time)s)"""235 moin_template = """ * '''%(line)s''' (%(time)s)"""
236class Help(GenericItem):236class Help(GenericItem):
237 itemtype = 'HELP'237 itemtype = 'HELP'
238class Accepted(GenericItem):238class Accepted(GenericItem):
@@ -260,7 +260,7 @@
260 rst_template = """*%(itemtype)s*: %(startrst)s%(url)s %(line)s%(endrst)s (%(rstref)s_)"""260 rst_template = """*%(itemtype)s*: %(startrst)s%(url)s %(line)s%(endrst)s (%(rstref)s_)"""
261 text_template = """%(itemtype)s: %(starttext)s%(url)s %(line)s%(endtext)s (%(nick)s, %(time)s)"""261 text_template = """%(itemtype)s: %(starttext)s%(url)s %(line)s%(endtext)s (%(nick)s, %(time)s)"""
262 mw_template = """''%(itemtype)s:'' %(startmw)s%(url)s %(line)s%(endmw)s (%(nick)s, %(time)s)"""262 mw_template = """''%(itemtype)s:'' %(startmw)s%(url)s %(line)s%(endmw)s (%(nick)s, %(time)s)"""
263 moin_template = """''%(itemtype)s:'' %(startmw)s%(url)s %(line)s%(endmw)s (%(nick)s, %(time)s)"""263 moin_template = """''%(itemtype)s:'' %(startmw)s%(url)s %(line)s%(endmw)s"""
264 def __init__(self, nick, line, linenum, time_):264 def __init__(self, nick, line, linenum, time_):
265 self.nick = nick ; self.linenum = linenum265 self.nick = nick ; self.linenum = linenum
266 self.time = time.strftime("%H:%M:%S", time_)266 self.time = time.strftime("%H:%M:%S", time_)
267267
=== modified file 'meeting.py'
--- meeting.py 2011-09-20 16:35:45 +0000
+++ meeting.py 2013-05-18 11:54:26 +0000
@@ -37,6 +37,7 @@
3737
38import writers38import writers
39import items39import items
40
40reload(writers)41reload(writers)
41reload(items)42reload(items)
4243
@@ -434,11 +435,16 @@
434 self.votesrequired=0435 self.votesrequired=0
435 self.reply("votes now need %s to be passed"%self.votesrequired)436 self.reply("votes now need %s to be passed"%self.votesrequired)
436 def do_endvote(self, nick, line, **kwargs):437 def do_endvote(self, nick, line, **kwargs):
438
437 if not self.isChair(nick): return439 if not self.isChair(nick): return
440
438 """this vote is over, record the results"""441 """this vote is over, record the results"""
439 if self.activeVote=="":442 if self.activeVote=="":
440 self.reply("No vote in progress")443 self.reply("No vote in progress")
441 return444 return
445
446
447
442 self.reply("Voting ended on: "+self.activeVote)448 self.reply("Voting ended on: "+self.activeVote)
443 #should probably just store the summary of the results449 #should probably just store the summary of the results
444 vfor=0450 vfor=0
@@ -451,20 +457,36 @@
451 vabstain+=1457 vabstain+=1
452 elif re.match("\+1",self.currentVote[v]):458 elif re.match("\+1",self.currentVote[v]):
453 vfor+=1459 vfor+=1
460
461 voteResult = "Carried"
462
454 self.reply("Votes for:"+str(vfor)+" Votes against:"+str(vagainst)+" Abstentions:"+str(vabstain))463 self.reply("Votes for:"+str(vfor)+" Votes against:"+str(vagainst)+" Abstentions:"+str(vabstain))
455 if vfor-vagainst>self.votesrequired:464 if vfor-vagainst>self.votesrequired:
456 self.reply("Motion carried")465 self.reply("Motion carried")
466 voteResult = "Carried"
457 elif vfor-vagainst<self.votesrequired:467 elif vfor-vagainst<self.votesrequired:
458 self.reply("Motion denied")468 self.reply("Motion denied")
469 voteResult = "Denied"
459 else:470 else:
460 if self.votesrequired==0:471 if self.votesrequired==0:
461 self.reply("Deadlock, casting vote may be used")472 self.reply("Deadlock, casting vote may be used")
473 voteResult = "Deadlock"
462 else:474 else:
463 self.reply("Motion carried")475 self.reply("Motion carried")
476 voteResult = "Carried"
464 self.votes[self.activeVote]=[vfor,vabstain,vagainst]#store the results477 self.votes[self.activeVote]=[vfor,vabstain,vagainst]#store the results
465478
479 """Add informational item to the minutes."""
480 voteResultLog = "''Vote:'' "+self.activeVote+" ("+voteResult+")"
481
482 m = items.Info(nick=nick, line=voteResultLog, **kwargs)
483 self.additem(m)
484
466 self.activeVote=""#allow another vote to be called485 self.activeVote=""#allow another vote to be called
467 self.currentVote={}486 self.currentVote={}
487
488
489
468 def do_voters(self, nick,line,**kwargs):490 def do_voters(self, nick,line,**kwargs):
469 if not self.isChair(nick): return491 if not self.isChair(nick): return
470 """provide a list of authorised voters"""492 """provide a list of authorised voters"""
@@ -665,10 +687,10 @@
665687
666 # Handle the logging of the line688 # Handle the logging of the line
667 if line[:6] == 'ACTION':689 if line[:6] == 'ACTION':
668 logline = "%s * %s %s"%(time.strftime("%H:%M:%S", time_),690 logline = "%s * %s %s"%(time.strftime("%H:%M", time_),
669 nick, line[7:].strip())691 nick, line[7:].strip())
670 else:692 else:
671 logline = "%s <%s> %s"%(time.strftime("%H:%M:%S", time_),693 logline = "%s <%s> %s"%(time.strftime("%H:%M", time_),
672 nick, line.strip())694 nick, line.strip())
673 self.lines.append(logline)695 self.lines.append(logline)
674 linenum = len(self.lines)696 linenum = len(self.lines)
675697
=== modified file 'meetingLocalConfig.py'
--- meetingLocalConfig.py 2012-06-17 02:15:05 +0000
+++ meetingLocalConfig.py 2013-05-18 11:54:26 +0000
@@ -16,4 +16,4 @@
16 '.moin.txt':writers.Moin,16 '.moin.txt':writers.Moin,
17 #'.mw.txt':writers.MediaWiki,17 #'.mw.txt':writers.MediaWiki,
18 }18 }
19 command_RE = re.compile(r'[#|\[]([\w]+)[\]]?[ \t]*(.*)')19 command_RE = re.compile(r'[#|\[]([\w]+)[\]]?[ \t]*(.*)')
20\ No newline at end of file20\ No newline at end of file
2121
=== modified file 'plugin.py'
--- plugin.py 2011-08-29 22:42:59 +0000
+++ plugin.py 2013-05-18 11:54:26 +0000
@@ -90,7 +90,7 @@
90 M = meeting_cache.get(Mkey, None)90 M = meeting_cache.get(Mkey, None)
9191
92 # Start meeting if we are requested92 # Start meeting if we are requested
93 if payload[:13] == '#startmeeting':93 if payload[:13].lower() == '#startmeeting':
94 if M is not None:94 if M is not None:
95 irc.error("Can't start another meeting, one is in progress.")95 irc.error("Can't start another meeting, one is in progress.")
96 return96 return
@@ -114,7 +114,7 @@
114 (channel, network, time.ctime()))114 (channel, network, time.ctime()))
115 if len(recent_meetings) > 10:115 if len(recent_meetings) > 10:
116 del recent_meetings[0]116 del recent_meetings[0]
117 if payload[:7]=='#replay':117 if payload[:7].lower() =='#replay':
118 if M is not None:118 if M is not None:
119 irc.error("Can't replay logs while a meeting is in progress.")119 irc.error("Can't replay logs while a meeting is in progress.")
120 return120 return
121121
=== modified file 'writers.py'
--- writers.py 2010-09-02 19:16:45 +0000
+++ writers.py 2013-05-18 11:54:26 +0000
@@ -1,4 +1,4 @@
1# Richard Darst, June 20091# Richard Darst, June 2009
22
3###3###
4# Copyright (c) 2009, Richard Darst4# Copyright (c) 2009, Richard Darst
@@ -108,7 +108,10 @@
108 return {'pageTitle':self.pagetitle,108 return {'pageTitle':self.pagetitle,
109 'owner':self.M.owner,109 'owner':self.M.owner,
110 'starttime':time.strftime("%H:%M:%S", self.M.starttime),110 'starttime':time.strftime("%H:%M:%S", self.M.starttime),
111 'starttimeshort':time.strftime("%H:%M", self.M.starttime),
112 'startdate':time.strftime("%d %b", self.M.starttime),
111 'endtime':time.strftime("%H:%M:%S", self.M.endtime),113 'endtime':time.strftime("%H:%M:%S", self.M.endtime),
114 'endtimeshort':time.strftime("%H:%M", self.M.endtime),
112 'timeZone':self.M.config.timeZone,115 'timeZone':self.M.config.timeZone,
113 'fullLogs':self.M.config.basename+'.log.html',116 'fullLogs':self.M.config.basename+'.log.html',
114 'fullLogsFullURL':self.M.config.filename(url=True)+'.log.html',117 'fullLogsFullURL':self.M.config.filename(url=True)+'.log.html',
@@ -1189,8 +1192,10 @@
1189 if haveTopic:1192 if haveTopic:
1190 MeetingItems.append("") # line break1193 MeetingItems.append("") # line break
1191 haveTopic = True1194 haveTopic = True
1192 else:1195 elif m.itemtype == "SUBTOPIC":
1193 if haveTopic: item = ""+item1196 if haveTopic: item = ""+item
1197 else:
1198 if haveTopic: item = " * "+item
1194 MeetingItems.append(item)1199 MeetingItems.append(item)
1195 MeetingItems = '\n'.join(MeetingItems)1200 MeetingItems = '\n'.join(MeetingItems)
1196 return MeetingItems1201 return MeetingItems
@@ -1208,11 +1213,17 @@
1208 M = self.M1213 M = self.M
1209 # Votes1214 # Votes
1210 Votes = [ ]1215 Votes = [ ]
1211 Votes.append(self.heading('Votes'))1216 Votes.append(self.heading('Vote results'))
1212 for m in M.votes:1217 for m in M.votes:
1213 #differentiate denied votes somehow, strikethrough perhaps?1218 #differentiate denied votes somehow, strikethrough perhaps?
1214 Votes.append("\n * "+m)1219 Votes.append("\n * "+m)
1215 Votes.append(" For: "+str(M.votes[m][0])+" Against: "+str(M.votes[m][2])+" Abstained: "+str(M.votes[m][1]))1220 motion = "Deadlock"
1221 if(M.votes[m][0] > M.votes[m][1]):
1222 motion = "Motion carried"
1223 elif(M.votes[m][0] < M.votes[m][2]):
1224 motion = "Motion denied"
1225
1226 Votes.append(" * " + motion + " (For/Against/Abstained "+str(M.votes[m][0])+"/"+str(M.votes[m][2])+"/"+str(M.votes[m][1]) + ")")
1216 Votes = "\n".join(Votes)1227 Votes = "\n".join(Votes)
1217 return Votes1228 return Votes
12181229
@@ -1248,7 +1259,7 @@
1248 if not headerPrinted:1259 if not headerPrinted:
1249 ActionItemsPerson.append(" * %s"%moin(nick))1260 ActionItemsPerson.append(" * %s"%moin(nick))
1250 headerPrinted = True1261 headerPrinted = True
1251 ActionItemsPerson.append(" ** %s"%moin(m.line))1262 ActionItemsPerson.append(" * %s"%moin(m.line))
1252 numberAssigned += 11263 numberAssigned += 1
1253 m.assigned = True1264 m.assigned = True
1254 # unassigned items:1265 # unassigned items:
@@ -1287,11 +1298,9 @@
12871298
12881299
1289 body_start = textwrap.dedent("""\1300 body_start = textwrap.dedent("""\
1290 %(pageTitleHeading)s1301 == Meeting information ==
12911302 * %(pageTitleHeading)s, %(startdate)s at %(starttimeshort)s &mdash; %(endtimeshort)s %(timeZone)s
1292 sWRAPsMeeting started by %(owner)s at %(starttime)s1303 * Full logs at [[%(fullLogsFullURL)s]]""")
1293 %(timeZone)s. The full logs are available at
1294 %(fullLogsFullURL)s .eWRAPe""")
1295 def format(self, extension=None):1304 def format(self, extension=None):
1296 """Return a MoinMoin formatted minutes summary."""1305 """Return a MoinMoin formatted minutes summary."""
1297 M = self.M1306 M = self.M
@@ -1299,15 +1308,13 @@
1299 # Actual formatting and replacement1308 # Actual formatting and replacement
1300 repl = self.replacements()1309 repl = self.replacements()
1301 repl.update({'titleBlock':('='*len(repl['pageTitle'])),1310 repl.update({'titleBlock':('='*len(repl['pageTitle'])),
1302 'pageTitleHeading':('#title '+repl['pageTitle'])1311 'pageTitleHeading':(repl['pageTitle'])
1303 })1312 })
13041313
13051314
1306 body = [ ]1315 body = [ ]
1307 body.append(self.body_start%repl)1316 body.append(self.body_start%repl)
1308 body.append(self.meetingItems())1317 body.append(self.meetingItems())
1309 body.append(textwrap.dedent("""\
1310 Meeting ended at %(endtime)s %(timeZone)s."""%repl))
1311 body.append(self.votes())1318 body.append(self.votes())
1312 body.append(self.actionItems())1319 body.append(self.actionItems())
1313 body.append(self.actionItemsPerson())1320 body.append(self.actionItemsPerson())

Subscribers

People subscribed via source and target branches