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 1QV4rH-0004RZ-AF for garchives@archives.gentoo.org; Fri, 10 Jun 2011 16:46:55 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 50F0F1C06E; Fri, 10 Jun 2011 16:46:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id ECFE21C06E for ; Fri, 10 Jun 2011 16:46:37 +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 779451B402E for ; Fri, 10 Jun 2011 16:46:37 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id A173B8003C for ; Fri, 10 Jun 2011 16:46:36 +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: f9e5580110558ccc7a2e0f28791f5e19681bd562 Date: Fri, 10 Jun 2011 16:46:36 +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: 30e6cf77944c558bf36127989de926a7 commit: f9e5580110558ccc7a2e0f28791f5e19681bd562 Author: Joachim Filip Ignacy Bartosik gmail com= > AuthorDate: Mon May 23 11:17:40 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Fri Jun 10 15:29:31 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/council-webap= p.git;a=3Dcommit;h=3Df9e55801 Bot obtains voters, agenda items and voting options lists from webapp --- bot/ircmeeting/agenda.py | 4 ++-- bot/ircmeeting/meeting.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bot/ircmeeting/agenda.py b/bot/ircmeeting/agenda.py index 4f0bd00..2269f6f 100644 --- a/bot/ircmeeting/agenda.py +++ b/bot/ircmeeting/agenda.py @@ -54,7 +54,7 @@ class Agenda(object): self._vote_open =3D True options =3D "\n" for i in range(len(self._agenda[self._current_item][1])): - options +=3D str.format("{}. {}\n", i, self._agenda[self._cu= rrent_item][i]) + options +=3D str.format("{}. {}\n", i, self._agenda[self._cu= rrent_item][1][i]) return str.format(self.voting_open_msg, options) =20 def end_vote(self): @@ -82,7 +82,7 @@ class Agenda(object): return self.out_of_range_msg =20 self._votes[self._agenda[self._current_item][0]][nick] =3D self.= _agenda[self._current_item][1][opt] - return str.format(self.vote_confirm_msg, opt, self._agenda[self.= _current_item][opt]) + return str.format(self.vote_confirm_msg, opt, self._agenda[self.= _current_item][1][opt]) =20 def _get_json(self, url): str =3D urllib.urlopen(url).read() diff --git a/bot/ircmeeting/meeting.py b/bot/ircmeeting/meeting.py index a49aaaf..108ae1d 100644 --- a/bot/ircmeeting/meeting.py +++ b/bot/ircmeeting/meeting.py @@ -331,8 +331,13 @@ class MeetingCommands(object): for messageline in self.config.agenda.start_vote().split('\n'): self.reply(messageline) =20 + def do_endvote(self, nick, time_, line, **kwargs): + for messageline in self.config.agenda.end_vote().split('\n'): + self.reply(messageline) + def do_vote(self, nick, time_, line, **kwargs): - self.reply(self.config.agenda.vote(nick, line)) + for messageline in self.config.agenda.vote(nick, line).split('\n= '): + self.reply(messageline) =20 def do_endmeeting(self, nick, time_, **kwargs): """End the meeting.""" @@ -696,4 +701,3 @@ if __name__ =3D=3D '__main__': #M.save() # should be done by #endmeeting in the logs! else: print 'Command "%s" not found.'%sys.argv[1] -