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
1=== modified file 'meeting.py'
2--- meeting.py 2013-07-13 15:35:33 +0000
3+++ meeting.py 2013-07-24 18:42:25 +0000
4@@ -419,7 +419,7 @@
5 self.reply("Voting still open on: " + self.activeVote)
6 return
7 self.reply("Please vote on: " + line.strip())
8- 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)")
9+ 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)")
10 self.activeVote=line.strip()
11 self.currentVote={}
12 #need to set up a structure to hold vote results
13
14=== modified file 'plugin.py'
15--- plugin.py 2013-07-13 15:35:33 +0000
16+++ plugin.py 2013-07-24 18:42:25 +0000
17@@ -125,7 +125,26 @@
18 (channel, network, time.ctime()))
19 if len(recent_meetings) > 10:
20 del recent_meetings[0]
21-
22+
23+ # If there is no meeting going on, then we quit
24+ if M is None: return
25+ # Add line to our meeting buffer.
26+ isop=(nick in irc.state.channels[channel].ops)
27+ M.addline(nick, payload,isop)
28+ # End meeting if requested:
29+ if M._meetingIsOver:
30+ #M.save() # now do_endmeeting in M calls the save functions
31+ del meeting_cache[Mkey]
32+
33+ def vote(self, irc, msg, args):
34+ nick = msg.nick
35+ channel = msg.args[0]
36+ payload = msg.args[1]
37+ network = irc.msg.tags['receivedOn']
38+
39+ """ sub string to remove 'vote ' from payload """
40+ payload = payload[5:]
41+
42 """ private voting system """
43 if channel[:1] != '#' and re.match("\+1|0|\+0|-1",payload):
44 for key in meeting_cache.keys():
45@@ -135,21 +154,10 @@
46 time_ = time.localtime()
47 private = True
48 voteMeeting.doCastVote(nick,payload,time_,private)
49- irc.reply("received for vote " + voteMeeting.activeVote)
50+ irc.reply("received for vote '" + voteMeeting.activeVote + "'")
51 else:
52 irc.reply("No active meetings in this channel")
53-
54-
55- # If there is no meeting going on, then we quit
56- if M is None: return
57- # Add line to our meeting buffer.
58- isop=(nick in irc.state.channels[channel].ops)
59- M.addline(nick, payload,isop)
60- # End meeting if requested:
61- if M._meetingIsOver:
62- #M.save() # now do_endmeeting in M calls the save functions
63- del meeting_cache[Mkey]
64-
65+
66 def outFilter(self, irc, msg):
67 """Log outgoing messages from supybot.
68 """

Subscribers

People subscribed via source and target branches