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

Proposed by Thomas Molloy
Status: Merged
Merged at revision: 14
Proposed branch: lp:~lderan/ubuntu-bots/meeetingology-output
Merge into: lp:~ubuntu-bots/ubuntu-bots/meetingology
Diff against target: 68 lines (+23/-15)
2 files modified
meeting.py (+1/-1)
plugin.py (+22/-14)
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+176757@code.launchpad.net

Description of the change

Changed private voting to be an actual bot function so it no longer returns an error to the user when they try to vote. Also changed the vote announcement to show how to go about private voting

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

yes, this looks good

review: Approve
14. By Alan Bell

accepting merge for private voting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'meeting.py'
--- meeting.py 2013-07-13 15:35:33 +0000
+++ meeting.py 2013-07-24 18:42:25 +0000
@@ -419,7 +419,7 @@
419 self.reply("Voting still open on: " + self.activeVote)419 self.reply("Voting still open on: " + self.activeVote)
420 return420 return
421 self.reply("Please vote on: " + line.strip())421 self.reply("Please vote on: " + line.strip())
422 self.reply("Public votes can be registered by saying +1, +0 or -1 in channel, (private votes don't work yet, but when they do it will be by messaging the channel followed by +1/-1/+0 to me)")422 self.reply("Public votes can be registered by saying +1, +0 or -1 in channel, (for private voting, private message me with 'vote +1/-1/+0 #channelname)")
423 self.activeVote=line.strip()423 self.activeVote=line.strip()
424 self.currentVote={}424 self.currentVote={}
425 #need to set up a structure to hold vote results425 #need to set up a structure to hold vote results
426426
=== modified file 'plugin.py'
--- plugin.py 2013-07-13 15:35:33 +0000
+++ plugin.py 2013-07-24 18:42:25 +0000
@@ -125,7 +125,26 @@
125 (channel, network, time.ctime()))125 (channel, network, time.ctime()))
126 if len(recent_meetings) > 10:126 if len(recent_meetings) > 10:
127 del recent_meetings[0]127 del recent_meetings[0]
128 128
129 # If there is no meeting going on, then we quit
130 if M is None: return
131 # Add line to our meeting buffer.
132 isop=(nick in irc.state.channels[channel].ops)
133 M.addline(nick, payload,isop)
134 # End meeting if requested:
135 if M._meetingIsOver:
136 #M.save() # now do_endmeeting in M calls the save functions
137 del meeting_cache[Mkey]
138
139 def vote(self, irc, msg, args):
140 nick = msg.nick
141 channel = msg.args[0]
142 payload = msg.args[1]
143 network = irc.msg.tags['receivedOn']
144
145 """ sub string to remove 'vote ' from payload """
146 payload = payload[5:]
147
129 """ private voting system """148 """ private voting system """
130 if channel[:1] != '#' and re.match("\+1|0|\+0|-1",payload):149 if channel[:1] != '#' and re.match("\+1|0|\+0|-1",payload):
131 for key in meeting_cache.keys():150 for key in meeting_cache.keys():
@@ -135,21 +154,10 @@
135 time_ = time.localtime()154 time_ = time.localtime()
136 private = True155 private = True
137 voteMeeting.doCastVote(nick,payload,time_,private)156 voteMeeting.doCastVote(nick,payload,time_,private)
138 irc.reply("received for vote " + voteMeeting.activeVote)157 irc.reply("received for vote '" + voteMeeting.activeVote + "'")
139 else:158 else:
140 irc.reply("No active meetings in this channel")159 irc.reply("No active meetings in this channel")
141 160
142
143 # If there is no meeting going on, then we quit
144 if M is None: return
145 # Add line to our meeting buffer.
146 isop=(nick in irc.state.channels[channel].ops)
147 M.addline(nick, payload,isop)
148 # End meeting if requested:
149 if M._meetingIsOver:
150 #M.save() # now do_endmeeting in M calls the save functions
151 del meeting_cache[Mkey]
152
153 def outFilter(self, irc, msg):161 def outFilter(self, irc, msg):
154 """Log outgoing messages from supybot.162 """Log outgoing messages from supybot.
155 """163 """

Subscribers

People subscribed via source and target branches