Thomas Molloy has proposed merging lp:~lderan/ubuntu-bots/meeetingology-output into lp:~ubuntu-bots/ubuntu-bots/meetingology.
Requested reviews: Ubuntu IRC Bots (ubuntu-bots) For more details, see: https://code.launchpad.net/~lderan/ubuntu-bots/meeetingology-output/+merge/164589 Formatting the output for the MoinMoin wikis. Adding votes to the top of the meeting information with results -- https://code.launchpad.net/~lderan/ubuntu-bots/meeetingology-output/+merge/164589 Your team Ubuntu IRC Bots is requested to review the proposed merge of lp:~lderan/ubuntu-bots/meeetingology-output into lp:~ubuntu-bots/ubuntu-bots/meetingology.
=== 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 @@ text_template = """%(starttext)s%(topic)s%(endtext)s (%(nick)s, %(time)s)""" mw_template = """%(startmw)s%(topic)s%(endmw)s (%(nick)s, %(time)s)""" moin_template = """%(startmoin)s%(topic)s%(endmoin)s (%(nick)s, %(time)s)""" - moin_template = """ *%(topic)s""" + moin_template = """=== %(topic)s ===\nThe discussion about \"%(topic)s\" started at %(time)s.\n""" startrst = '**' endrst = '**' @@ -140,7 +140,7 @@ endmoin = '' def __init__(self, nick, line, linenum, time_): self.nick = nick ; self.topic = line ; self.linenum = linenum - self.time = time.strftime("%H:%M:%S", time_) + self.time = time.strftime("%H:%M", time_) def _htmlrepl(self, M): repl = self.get_replacements(M, escapewith=writers.html) repl['link'] = self.logURL(M) @@ -186,7 +186,7 @@ moin_template = """''%(itemtype)s:'' %(startmw)s%(line)s%(endmw)s (%(nick)s, %(time)s)""" def __init__(self, nick, line, linenum, time_): self.nick = nick ; self.line = line ; self.linenum = linenum - self.time = time.strftime("%H:%M:%S", time_) + self.time = time.strftime("%H:%M", time_) def _htmlrepl(self, M): repl = self.get_replacements(M, escapewith=writers.html) repl['link'] = self.logURL(M) @@ -211,7 +211,6 @@ repl = self.get_replacements(M, escapewith=writers.moin) return self.moin_template%repl - class Info(GenericItem): itemtype = 'INFO' html2_template = ("""<span class="%(itemtype)s">""" @@ -223,16 +222,17 @@ rst_template = """%(startrst)s%(line)s%(endrst)s (%(rstref)s_)""" text_template = """%(starttext)s%(line)s%(endtext)s (%(nick)s, %(time)s)""" mw_template = """%(startmw)s%(line)s%(endmw)s (%(nick)s, %(time)s)""" - moin_template = """%(startmoin)s%(line)s%(endmoin)s (%(nick)s, %(time)s)""" + moin_template = """%(startmoin)s%(line)s%(endmoin)s""" class Idea(GenericItem): itemtype = 'IDEA' class Agreed(GenericItem): itemtype = 'AGREED' class Action(GenericItem): itemtype = 'ACTION' + moin_template = """''ACTION:'' %(line)s""" class Subtopic(GenericItem): itemtype = 'SUBTOPIC' - moin_template = """ *%(line)s (%(nick)s, %(time)s)""" + moin_template = """ * '''%(line)s''' (%(time)s)""" class Help(GenericItem): itemtype = 'HELP' class Accepted(GenericItem): @@ -260,7 +260,7 @@ rst_template = """*%(itemtype)s*: %(startrst)s%(url)s %(line)s%(endrst)s (%(rstref)s_)""" text_template = """%(itemtype)s: %(starttext)s%(url)s %(line)s%(endtext)s (%(nick)s, %(time)s)""" mw_template = """''%(itemtype)s:'' %(startmw)s%(url)s %(line)s%(endmw)s (%(nick)s, %(time)s)""" - moin_template = """''%(itemtype)s:'' %(startmw)s%(url)s %(line)s%(endmw)s (%(nick)s, %(time)s)""" + moin_template = """''%(itemtype)s:'' %(startmw)s%(url)s %(line)s%(endmw)s""" def __init__(self, nick, line, linenum, time_): self.nick = nick ; self.linenum = linenum self.time = time.strftime("%H:%M:%S", time_) === 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 @@ import writers import items + reload(writers) reload(items) @@ -434,11 +435,16 @@ self.votesrequired=0 self.reply("votes now need %s to be passed"%self.votesrequired) def do_endvote(self, nick, line, **kwargs): + if not self.isChair(nick): return + """this vote is over, record the results""" if self.activeVote=="": self.reply("No vote in progress") return + + + self.reply("Voting ended on: "+self.activeVote) #should probably just store the summary of the results vfor=0 @@ -451,20 +457,36 @@ vabstain+=1 elif re.match("\+1",self.currentVote[v]): vfor+=1 + + voteResult = "Carried" + self.reply("Votes for:"+str(vfor)+" Votes against:"+str(vagainst)+" Abstentions:"+str(vabstain)) if vfor-vagainst>self.votesrequired: self.reply("Motion carried") + voteResult = "Carried" elif vfor-vagainst<self.votesrequired: self.reply("Motion denied") + voteResult = "Denied" else: if self.votesrequired==0: self.reply("Deadlock, casting vote may be used") + voteResult = "Deadlock" else: self.reply("Motion carried") + voteResult = "Carried" self.votes[self.activeVote]=[vfor,vabstain,vagainst]#store the results - + + """Add informational item to the minutes.""" + voteResultLog = "''Vote:'' "+self.activeVote+" ("+voteResult+")" + + m = items.Info(nick=nick, line=voteResultLog, **kwargs) + self.additem(m) + self.activeVote=""#allow another vote to be called self.currentVote={} + + + def do_voters(self, nick,line,**kwargs): if not self.isChair(nick): return """provide a list of authorised voters""" @@ -665,10 +687,10 @@ # Handle the logging of the line if line[:6] == 'ACTION': - logline = "%s * %s %s"%(time.strftime("%H:%M:%S", time_), + logline = "%s * %s %s"%(time.strftime("%H:%M", time_), nick, line[7:].strip()) else: - logline = "%s <%s> %s"%(time.strftime("%H:%M:%S", time_), + logline = "%s <%s> %s"%(time.strftime("%H:%M", time_), nick, line.strip()) self.lines.append(logline) linenum = len(self.lines) === 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 @@ '.moin.txt':writers.Moin, #'.mw.txt':writers.MediaWiki, } - command_RE = re.compile(r'[#|\[]([\w]+)[\]]?[ \t]*(.*)') + command_RE = re.compile(r'[#|\[]([\w]+)[\]]?[ \t]*(.*)') \ No newline at end of file === 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 @@ M = meeting_cache.get(Mkey, None) # Start meeting if we are requested - if payload[:13] == '#startmeeting': + if payload[:13].lower() == '#startmeeting': if M is not None: irc.error("Can't start another meeting, one is in progress.") return @@ -114,7 +114,7 @@ (channel, network, time.ctime())) if len(recent_meetings) > 10: del recent_meetings[0] - if payload[:7]=='#replay': + if payload[:7].lower() =='#replay': if M is not None: irc.error("Can't replay logs while a meeting is in progress.") return === 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 @@ -# Richard Darst, June 2009 +# Richard Darst, June 2009 ### # Copyright (c) 2009, Richard Darst @@ -108,7 +108,10 @@ return {'pageTitle':self.pagetitle, 'owner':self.M.owner, 'starttime':time.strftime("%H:%M:%S", self.M.starttime), + 'starttimeshort':time.strftime("%H:%M", self.M.starttime), + 'startdate':time.strftime("%d %b", self.M.starttime), 'endtime':time.strftime("%H:%M:%S", self.M.endtime), + 'endtimeshort':time.strftime("%H:%M", self.M.endtime), 'timeZone':self.M.config.timeZone, 'fullLogs':self.M.config.basename+'.log.html', 'fullLogsFullURL':self.M.config.filename(url=True)+'.log.html', @@ -1189,8 +1192,10 @@ if haveTopic: MeetingItems.append("") # line break haveTopic = True - else: + elif m.itemtype == "SUBTOPIC": if haveTopic: item = ""+item + else: + if haveTopic: item = " * "+item MeetingItems.append(item) MeetingItems = '\n'.join(MeetingItems) return MeetingItems @@ -1208,11 +1213,17 @@ M = self.M # Votes Votes = [ ] - Votes.append(self.heading('Votes')) + Votes.append(self.heading('Vote results')) for m in M.votes: #differentiate denied votes somehow, strikethrough perhaps? Votes.append("\n * "+m) - Votes.append(" For: "+str(M.votes[m][0])+" Against: "+str(M.votes[m][2])+" Abstained: "+str(M.votes[m][1])) + motion = "Deadlock" + if(M.votes[m][0] > M.votes[m][1]): + motion = "Motion carried" + elif(M.votes[m][0] < M.votes[m][2]): + motion = "Motion denied" + + Votes.append(" * " + motion + " (For/Against/Abstained "+str(M.votes[m][0])+"/"+str(M.votes[m][2])+"/"+str(M.votes[m][1]) + ")") Votes = "\n".join(Votes) return Votes @@ -1248,7 +1259,7 @@ if not headerPrinted: ActionItemsPerson.append(" * %s"%moin(nick)) headerPrinted = True - ActionItemsPerson.append(" ** %s"%moin(m.line)) + ActionItemsPerson.append(" * %s"%moin(m.line)) numberAssigned += 1 m.assigned = True # unassigned items: @@ -1287,11 +1298,9 @@ body_start = textwrap.dedent("""\ - %(pageTitleHeading)s - - sWRAPsMeeting started by %(owner)s at %(starttime)s - %(timeZone)s. The full logs are available at - %(fullLogsFullURL)s .eWRAPe""") + == Meeting information == + * %(pageTitleHeading)s, %(startdate)s at %(starttimeshort)s — %(endtimeshort)s %(timeZone)s + * Full logs at [[%(fullLogsFullURL)s]]""") def format(self, extension=None): """Return a MoinMoin formatted minutes summary.""" M = self.M @@ -1299,15 +1308,13 @@ # Actual formatting and replacement repl = self.replacements() repl.update({'titleBlock':('='*len(repl['pageTitle'])), - 'pageTitleHeading':('#title '+repl['pageTitle']) + 'pageTitleHeading':(repl['pageTitle']) }) body = [ ] body.append(self.body_start%repl) body.append(self.meetingItems()) - body.append(textwrap.dedent("""\ - Meeting ended at %(endtime)s %(timeZone)s."""%repl)) body.append(self.votes()) body.append(self.actionItems()) body.append(self.actionItemsPerson())
-- Mailing list: https://launchpad.net/~ubuntu-bots Post to : ubuntu-bots@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-bots More help : https://help.launchpad.net/ListHelp