~lderan/ubuntu-bots/meeetingology-output

« back to all changes in this revision

Viewing changes to plugin.py

  • Committer: Alan Bell
  • Date: 2013-08-29 09:12:35 UTC
  • mfrom: (12.1.5 meetingology)
  • Revision ID: alanbell@ubuntu.com-20130829091235-ihagdwur7j8izd2u
accepting merge for private voting

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
                (channel, network, time.ctime()))
126
126
            if len(recent_meetings) > 10:
127
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
148
        """ private voting system """
130
149
        if channel[:1] != '#' and re.match("\+1|0|\+0|-1",payload):
131
150
            for key in meeting_cache.keys():
135
154
                        time_ = time.localtime()
136
155
                        private = True
137
156
                        voteMeeting.doCastVote(nick,payload,time_,private)
138
 
                        irc.reply("received for vote " + voteMeeting.activeVote)
 
157
                        irc.reply("received for vote '" + voteMeeting.activeVote + "'")
139
158
                    else:
140
159
                        irc.reply("No active meetings in this channel")
141
 
        
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
 
 
 
160
                        
153
161
    def outFilter(self, irc, msg):
154
162
        """Log outgoing messages from supybot.
155
163
        """