← Back to team overview

ubuntu-bots team mailing list archive

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

 

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/165491

Changed the html log output so the anchor tags surround the timestamp for easier linking.

Adding in private votes, the bot accepts +1 /-1 /(+) 0 #channelname for the vote and responds with 
vote accepted with the vote title. If the vote is private it will check first to whether the user is allowed to vote. As for public votes it is oblivous and will accept votes from anyone at the moment.
-- 
https://code.launchpad.net/~lderan/ubuntu-bots/meeetingology-output/+merge/165491
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 'css-log-default.css'
--- css-log-default.css	2010-09-02 19:16:45 +0000
+++ css-log-default.css	2013-05-23 21:23:26 +0000
@@ -13,3 +13,6 @@
 body .topicline { color: #000080; font-weight: bold }
 body .cmd       { color: #007020; font-weight: bold }
 body .cmdline  { font-weight: bold }
+
+a {text-decoration:none;}
+a:hover {text-decoration:underline;}

=== modified file 'meeting.py'
--- meeting.py	2013-04-21 19:25:19 +0000
+++ meeting.py	2013-05-23 21:23:26 +0000
@@ -658,7 +658,7 @@
         self.save(realtime_update=True)
         if re.match("\+1|0|\+0|-1",line):
             self.doCastVote(nick,line,time_)
-    def doCastVote(self, nick, line, time_=None):
+    def doCastVote(self, nick, line, time_=None, private=False):
             """if a vote is underway and the nick is a registered voter
             and has not already voted in this vote
             add the voter name and record the vote
@@ -668,11 +668,12 @@
             if nick in self.voters or self.voters=={}:
                 if self.activeVote:
                     self.currentVote[nick]=line
-                    self.reply(line + " received from " + nick)
+                    if private is False:
+                        self.reply(line + " received from " + nick)
+						
             #if the vote was in a private message - how do we do that??
             #self.reply(line + " received from a private vote")
             #we do record the voter name in the voting structure even if private, so they can't vote twice
-            #we don't print that to the minutes or summary
 
     def addrawline(self, nick, line, time_=None):
         """This adds a line to the log, bypassing command execution.

=== modified file 'plugin.py'
--- plugin.py	2013-04-21 19:25:19 +0000
+++ plugin.py	2013-05-23 21:23:26 +0000
@@ -36,6 +36,7 @@
 import supybot.ircmsgs as ircmsgs
 
 import time
+import re
 import meeting
 import supybotconfig
 # Because of the way we override names, we need to reload these in order.
@@ -124,6 +125,20 @@
                 (channel, network, time.ctime()))
             if len(recent_meetings) > 10:
                 del recent_meetings[0]
+                
+        """ private voting system """
+        if channel[:1] != '#' and re.match("\+1|0|\+0|-1",payload):
+            for key in meeting_cache.keys():
+                if payload.endswith(key[0]):
+                    voteMeeting = meeting_cache.get(key, None)
+                    if voteMeeting is not None:
+                        time_ = time.localtime()
+                        private = True
+                        voteMeeting.doCastVote(nick,payload,time_,private)
+                        irc.reply("received for vote " + voteMeeting.activeVote)
+                    else:
+                        irc.reply("No active meetings in this channel")
+        
 
         # If there is no meeting going on, then we quit
         if M is None: return

=== modified file 'writers.py'
--- writers.py	2013-04-21 19:25:19 +0000
+++ writers.py	2013-05-23 21:23:26 +0000
@@ -456,8 +456,8 @@
                                (html(m2.group(1)),html(m2.group(2))))
                 if m2 is None:
                     outline = html(line)
-                lines.append('<a name="l-%(lineno)s"></a>'
-                             '<span class="tm">%(time)s</span>'
+                lines.append('<a href="#l-%(lineno)s" name="l-%(lineno)s">'
+                             '<span class="tm">%(time)s</span></a>'
                              '<span class="nk">%(nick)s</span> '
                              '%(line)s'%{'lineno':lineNumber,
                                          'time':html(m.group('time')),