public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Petteri Räty" <betelgeuse@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/council-webapp:master commit in: bot/ircmeeting/
Date: Sun,  5 Jun 2011 20:37:54 +0000 (UTC)	[thread overview]
Message-ID: <ff432f2e42e6ece77ee9539c25ca7f109f24cfcc.betelgeuse@gentoo> (raw)

commit:     ff432f2e42e6ece77ee9539c25ca7f109f24cfcc
Author:     Joachim Filip Ignacy Bartosik <jbartosik <AT> gmail <DOT> com>
AuthorDate: Fri Jun  3 14:59:33 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Jun  3 17:36:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/council-webapp.git;a=commit;h=ff432f2e

Bot posts voting results to webapp

---
 bot/ircmeeting/agenda.py  |    7 +++++++
 bot/ircmeeting/meeting.py |    5 +++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/bot/ircmeeting/agenda.py b/bot/ircmeeting/agenda.py
index 7ee9beb..4f0bd00 100644
--- a/bot/ircmeeting/agenda.py
+++ b/bot/ircmeeting/agenda.py
@@ -89,3 +89,10 @@ class Agenda(object):
         str = urllib.unquote(str)
         result = json.loads(str)
         return result
+
+    def post_result(self):
+        data = urllib.quote(json.dumps([self._votes]))
+        result_url = str.format(self.conf.result_url,
+                      self.conf.voting_results_user,
+                      self.conf.voting_results_password)
+        urllib.urlopen(result_url, data = data)

diff --git a/bot/ircmeeting/meeting.py b/bot/ircmeeting/meeting.py
index b22dac6..a49aaaf 100644
--- a/bot/ircmeeting/meeting.py
+++ b/bot/ircmeeting/meeting.py
@@ -101,6 +101,10 @@ class Config(object):
     # Meeting management urls
     voters_url = 'http://localhost:3000/users/voters'
     agenda_url = 'http://localhost:3000/agendas/current_items'
+    result_url = 'http://localhost:3000/agendas/current_items'
+    # Credentials for posting voting results
+    voting_results_user = 'user'
+    voting_results_password = 'password'
 
     def enc(self, text):
         return text.encode(self.output_codec, 'replace')
@@ -342,6 +346,7 @@ class MeetingCommands(object):
         for messageline in message.split('\n'):
             self.reply(messageline)
         self._meetingIsOver = True
+        self.config.agenda.post_result()
     def do_topic(self, nick, line, **kwargs):
         """Set a new topic in the channel."""
         if not self.isChair(nick): return



             reply	other threads:[~2011-06-05 20:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-05 20:37 Petteri Räty [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-06-10 16:46 [gentoo-commits] proj/council-webapp:master commit in: bot/ircmeeting/ Petteri Räty
2011-07-05 15:09 Petteri Räty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff432f2e42e6ece77ee9539c25ca7f109f24cfcc.betelgeuse@gentoo \
    --to=betelgeuse@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox