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
1=== modified file 'items.py'
2--- items.py 2010-09-02 19:16:45 +0000
3+++ items.py 2013-05-18 11:54:26 +0000
4@@ -128,7 +128,7 @@
5 text_template = """%(starttext)s%(topic)s%(endtext)s (%(nick)s, %(time)s)"""
6 mw_template = """%(startmw)s%(topic)s%(endmw)s (%(nick)s, %(time)s)"""
7 moin_template = """%(startmoin)s%(topic)s%(endmoin)s (%(nick)s, %(time)s)"""
8- moin_template = """ *%(topic)s"""
9+ moin_template = """=== %(topic)s ===\nThe discussion about \"%(topic)s\" started at %(time)s.\n"""
10
11 startrst = '**'
12 endrst = '**'
13@@ -140,7 +140,7 @@
14 endmoin = ''
15 def __init__(self, nick, line, linenum, time_):
16 self.nick = nick ; self.topic = line ; self.linenum = linenum
17- self.time = time.strftime("%H:%M:%S", time_)
18+ self.time = time.strftime("%H:%M", time_)
19 def _htmlrepl(self, M):
20 repl = self.get_replacements(M, escapewith=writers.html)
21 repl['link'] = self.logURL(M)
22@@ -186,7 +186,7 @@
23 moin_template = """''%(itemtype)s:'' %(startmw)s%(line)s%(endmw)s (%(nick)s, %(time)s)"""
24 def __init__(self, nick, line, linenum, time_):
25 self.nick = nick ; self.line = line ; self.linenum = linenum
26- self.time = time.strftime("%H:%M:%S", time_)
27+ self.time = time.strftime("%H:%M", time_)
28 def _htmlrepl(self, M):
29 repl = self.get_replacements(M, escapewith=writers.html)
30 repl['link'] = self.logURL(M)
31@@ -211,7 +211,6 @@
32 repl = self.get_replacements(M, escapewith=writers.moin)
33 return self.moin_template%repl
34
35-
36 class Info(GenericItem):
37 itemtype = 'INFO'
38 html2_template = ("""<span class="%(itemtype)s">"""
39@@ -223,16 +222,17 @@
40 rst_template = """%(startrst)s%(line)s%(endrst)s (%(rstref)s_)"""
41 text_template = """%(starttext)s%(line)s%(endtext)s (%(nick)s, %(time)s)"""
42 mw_template = """%(startmw)s%(line)s%(endmw)s (%(nick)s, %(time)s)"""
43- moin_template = """%(startmoin)s%(line)s%(endmoin)s (%(nick)s, %(time)s)"""
44+ moin_template = """%(startmoin)s%(line)s%(endmoin)s"""
45 class Idea(GenericItem):
46 itemtype = 'IDEA'
47 class Agreed(GenericItem):
48 itemtype = 'AGREED'
49 class Action(GenericItem):
50 itemtype = 'ACTION'
51+ moin_template = """''ACTION:'' %(line)s"""
52 class Subtopic(GenericItem):
53 itemtype = 'SUBTOPIC'
54- moin_template = """ *%(line)s (%(nick)s, %(time)s)"""
55+ moin_template = """ * '''%(line)s''' (%(time)s)"""
56 class Help(GenericItem):
57 itemtype = 'HELP'
58 class Accepted(GenericItem):
59@@ -260,7 +260,7 @@
60 rst_template = """*%(itemtype)s*: %(startrst)s%(url)s %(line)s%(endrst)s (%(rstref)s_)"""
61 text_template = """%(itemtype)s: %(starttext)s%(url)s %(line)s%(endtext)s (%(nick)s, %(time)s)"""
62 mw_template = """''%(itemtype)s:'' %(startmw)s%(url)s %(line)s%(endmw)s (%(nick)s, %(time)s)"""
63- moin_template = """''%(itemtype)s:'' %(startmw)s%(url)s %(line)s%(endmw)s (%(nick)s, %(time)s)"""
64+ moin_template = """''%(itemtype)s:'' %(startmw)s%(url)s %(line)s%(endmw)s"""
65 def __init__(self, nick, line, linenum, time_):
66 self.nick = nick ; self.linenum = linenum
67 self.time = time.strftime("%H:%M:%S", time_)
68
69=== modified file 'meeting.py'
70--- meeting.py 2011-09-20 16:35:45 +0000
71+++ meeting.py 2013-05-18 11:54:26 +0000
72@@ -37,6 +37,7 @@
73
74 import writers
75 import items
76+
77 reload(writers)
78 reload(items)
79
80@@ -434,11 +435,16 @@
81 self.votesrequired=0
82 self.reply("votes now need %s to be passed"%self.votesrequired)
83 def do_endvote(self, nick, line, **kwargs):
84+
85 if not self.isChair(nick): return
86+
87 """this vote is over, record the results"""
88 if self.activeVote=="":
89 self.reply("No vote in progress")
90 return
91+
92+
93+
94 self.reply("Voting ended on: "+self.activeVote)
95 #should probably just store the summary of the results
96 vfor=0
97@@ -451,20 +457,36 @@
98 vabstain+=1
99 elif re.match("\+1",self.currentVote[v]):
100 vfor+=1
101+
102+ voteResult = "Carried"
103+
104 self.reply("Votes for:"+str(vfor)+" Votes against:"+str(vagainst)+" Abstentions:"+str(vabstain))
105 if vfor-vagainst>self.votesrequired:
106 self.reply("Motion carried")
107+ voteResult = "Carried"
108 elif vfor-vagainst<self.votesrequired:
109 self.reply("Motion denied")
110+ voteResult = "Denied"
111 else:
112 if self.votesrequired==0:
113 self.reply("Deadlock, casting vote may be used")
114+ voteResult = "Deadlock"
115 else:
116 self.reply("Motion carried")
117+ voteResult = "Carried"
118 self.votes[self.activeVote]=[vfor,vabstain,vagainst]#store the results
119-
120+
121+ """Add informational item to the minutes."""
122+ voteResultLog = "''Vote:'' "+self.activeVote+" ("+voteResult+")"
123+
124+ m = items.Info(nick=nick, line=voteResultLog, **kwargs)
125+ self.additem(m)
126+
127 self.activeVote=""#allow another vote to be called
128 self.currentVote={}
129+
130+
131+
132 def do_voters(self, nick,line,**kwargs):
133 if not self.isChair(nick): return
134 """provide a list of authorised voters"""
135@@ -665,10 +687,10 @@
136
137 # Handle the logging of the line
138 if line[:6] == 'ACTION':
139- logline = "%s * %s %s"%(time.strftime("%H:%M:%S", time_),
140+ logline = "%s * %s %s"%(time.strftime("%H:%M", time_),
141 nick, line[7:].strip())
142 else:
143- logline = "%s <%s> %s"%(time.strftime("%H:%M:%S", time_),
144+ logline = "%s <%s> %s"%(time.strftime("%H:%M", time_),
145 nick, line.strip())
146 self.lines.append(logline)
147 linenum = len(self.lines)
148
149=== modified file 'meetingLocalConfig.py'
150--- meetingLocalConfig.py 2012-06-17 02:15:05 +0000
151+++ meetingLocalConfig.py 2013-05-18 11:54:26 +0000
152@@ -16,4 +16,4 @@
153 '.moin.txt':writers.Moin,
154 #'.mw.txt':writers.MediaWiki,
155 }
156- command_RE = re.compile(r'[#|\[]([\w]+)[\]]?[ \t]*(.*)')
157+ command_RE = re.compile(r'[#|\[]([\w]+)[\]]?[ \t]*(.*)')
158\ No newline at end of file
159
160=== modified file 'plugin.py'
161--- plugin.py 2011-08-29 22:42:59 +0000
162+++ plugin.py 2013-05-18 11:54:26 +0000
163@@ -90,7 +90,7 @@
164 M = meeting_cache.get(Mkey, None)
165
166 # Start meeting if we are requested
167- if payload[:13] == '#startmeeting':
168+ if payload[:13].lower() == '#startmeeting':
169 if M is not None:
170 irc.error("Can't start another meeting, one is in progress.")
171 return
172@@ -114,7 +114,7 @@
173 (channel, network, time.ctime()))
174 if len(recent_meetings) > 10:
175 del recent_meetings[0]
176- if payload[:7]=='#replay':
177+ if payload[:7].lower() =='#replay':
178 if M is not None:
179 irc.error("Can't replay logs while a meeting is in progress.")
180 return
181
182=== modified file 'writers.py'
183--- writers.py 2010-09-02 19:16:45 +0000
184+++ writers.py 2013-05-18 11:54:26 +0000
185@@ -1,4 +1,4 @@
186-# Richard Darst, June 2009
187+# Richard Darst, June 2009
188
189 ###
190 # Copyright (c) 2009, Richard Darst
191@@ -108,7 +108,10 @@
192 return {'pageTitle':self.pagetitle,
193 'owner':self.M.owner,
194 'starttime':time.strftime("%H:%M:%S", self.M.starttime),
195+ 'starttimeshort':time.strftime("%H:%M", self.M.starttime),
196+ 'startdate':time.strftime("%d %b", self.M.starttime),
197 'endtime':time.strftime("%H:%M:%S", self.M.endtime),
198+ 'endtimeshort':time.strftime("%H:%M", self.M.endtime),
199 'timeZone':self.M.config.timeZone,
200 'fullLogs':self.M.config.basename+'.log.html',
201 'fullLogsFullURL':self.M.config.filename(url=True)+'.log.html',
202@@ -1189,8 +1192,10 @@
203 if haveTopic:
204 MeetingItems.append("") # line break
205 haveTopic = True
206- else:
207+ elif m.itemtype == "SUBTOPIC":
208 if haveTopic: item = ""+item
209+ else:
210+ if haveTopic: item = " * "+item
211 MeetingItems.append(item)
212 MeetingItems = '\n'.join(MeetingItems)
213 return MeetingItems
214@@ -1208,11 +1213,17 @@
215 M = self.M
216 # Votes
217 Votes = [ ]
218- Votes.append(self.heading('Votes'))
219+ Votes.append(self.heading('Vote results'))
220 for m in M.votes:
221 #differentiate denied votes somehow, strikethrough perhaps?
222 Votes.append("\n * "+m)
223- Votes.append(" For: "+str(M.votes[m][0])+" Against: "+str(M.votes[m][2])+" Abstained: "+str(M.votes[m][1]))
224+ motion = "Deadlock"
225+ if(M.votes[m][0] > M.votes[m][1]):
226+ motion = "Motion carried"
227+ elif(M.votes[m][0] < M.votes[m][2]):
228+ motion = "Motion denied"
229+
230+ Votes.append(" * " + motion + " (For/Against/Abstained "+str(M.votes[m][0])+"/"+str(M.votes[m][2])+"/"+str(M.votes[m][1]) + ")")
231 Votes = "\n".join(Votes)
232 return Votes
233
234@@ -1248,7 +1259,7 @@
235 if not headerPrinted:
236 ActionItemsPerson.append(" * %s"%moin(nick))
237 headerPrinted = True
238- ActionItemsPerson.append(" ** %s"%moin(m.line))
239+ ActionItemsPerson.append(" * %s"%moin(m.line))
240 numberAssigned += 1
241 m.assigned = True
242 # unassigned items:
243@@ -1287,11 +1298,9 @@
244
245
246 body_start = textwrap.dedent("""\
247- %(pageTitleHeading)s
248-
249- sWRAPsMeeting started by %(owner)s at %(starttime)s
250- %(timeZone)s. The full logs are available at
251- %(fullLogsFullURL)s .eWRAPe""")
252+ == Meeting information ==
253+ * %(pageTitleHeading)s, %(startdate)s at %(starttimeshort)s &mdash; %(endtimeshort)s %(timeZone)s
254+ * Full logs at [[%(fullLogsFullURL)s]]""")
255 def format(self, extension=None):
256 """Return a MoinMoin formatted minutes summary."""
257 M = self.M
258@@ -1299,15 +1308,13 @@
259 # Actual formatting and replacement
260 repl = self.replacements()
261 repl.update({'titleBlock':('='*len(repl['pageTitle'])),
262- 'pageTitleHeading':('#title '+repl['pageTitle'])
263+ 'pageTitleHeading':(repl['pageTitle'])
264 })
265
266
267 body = [ ]
268 body.append(self.body_start%repl)
269 body.append(self.meetingItems())
270- body.append(textwrap.dedent("""\
271- Meeting ended at %(endtime)s %(timeZone)s."""%repl))
272 body.append(self.votes())
273 body.append(self.actionItems())
274 body.append(self.actionItemsPerson())

Subscribers

People subscribed via source and target branches