From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QTK60-000785-Qm for garchives@archives.gentoo.org; Sun, 05 Jun 2011 20:38:53 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E7D6B1C0AA; Sun, 5 Jun 2011 20:37:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id A87A81C0AE for ; Sun, 5 Jun 2011 20:37:55 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3C3F62AC03C for ; Sun, 5 Jun 2011 20:37:55 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 7D90180051 for ; Sun, 5 Jun 2011 20:37:54 +0000 (UTC) From: "Petteri Räty" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Petteri Räty" Message-ID: Subject: [gentoo-commits] proj/council-webapp:master commit in: bot/ircmeeting/ X-VCS-Repository: proj/council-webapp X-VCS-Files: bot/ircmeeting/agenda.py bot/ircmeeting/meeting.py X-VCS-Directories: bot/ircmeeting/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: ff432f2e42e6ece77ee9539c25ca7f109f24cfcc Date: Sun, 5 Jun 2011 20:37:54 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 6e91229bc9e5240fc2e3ba7dbbc5d00b commit: ff432f2e42e6ece77ee9539c25ca7f109f24cfcc Author: Joachim Filip Ignacy Bartosik gmail com= > AuthorDate: Fri Jun 3 14:59:33 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Fri Jun 3 17:36:26 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/council-webap= p.git;a=3Dcommit;h=3Dff432f2e 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 =3D urllib.unquote(str) result =3D json.loads(str) return result + + def post_result(self): + data =3D urllib.quote(json.dumps([self._votes])) + result_url =3D str.format(self.conf.result_url, + self.conf.voting_results_user, + self.conf.voting_results_password) + urllib.urlopen(result_url, data =3D 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 =3D 'http://localhost:3000/users/voters' agenda_url =3D 'http://localhost:3000/agendas/current_items' + result_url =3D 'http://localhost:3000/agendas/current_items' + # Credentials for posting voting results + voting_results_user =3D 'user' + voting_results_password =3D 'password' =20 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 =3D 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