Exemplo n.º 1
0
    def __str__(self) -> str:
        total_votes = sum(self._options.values())

        result = ''
        keys = sorted(self._options.keys())
        for index, option in enumerate(keys):
            votes = self._options[option]
            result += '%s %d. %s (%d votes)\n' % (drawbar(votes, total_votes), index+1, option, votes)

        return result.strip()
Exemplo n.º 2
0
    def __str__(self) -> str:
        total_votes = sum(self._options.values())

        result = ''
        keys = sorted(self._options.keys())
        for index, option in enumerate(keys):
            votes = self._options[option]
            result += '%s %d. %s (%d votes)\n' % (drawbar(
                votes, total_votes), index + 1, option, votes)

        return result.strip()
Exemplo n.º 3
0
    def format_poll(self, title):
        poll = self.shelf[title]

        total_votes = sum(poll[0].values())

        result = PollBot.active_poll + u'\n'
        index = 1
        for option in poll[0]:
            result += u'%s %d. %s (%d votes)\n' % (drawbar(poll[0][option], total_votes), index, option, poll[0][option])
            index += 1

        return result.strip()
Exemplo n.º 4
0
    def format_poll(self, title):
        poll = self[title]
        options, usernames = poll

        total_votes = sum(options.values())

        result = Poll.active_poll + '\n'
        index = 1
        for option in options:
            result += '%s %d. %s (%d votes)\n' % (drawbar(poll[0][option], total_votes), index, option, poll[0][option])
            index += 1

        return result.strip()
Exemplo n.º 5
0
    def format_poll(self, title):
        poll = self.shelf[title]

        total_votes = sum(poll[0].values())

        result = PollBot.active_poll + u'\n'
        index = 1
        for option in poll[0]:
            result += u'%s %d. %s (%d votes)\n' % (drawbar(
                poll[0][option], total_votes), index, option, poll[0][option])
            index += 1

        return result.strip()
Exemplo n.º 6
0
    def format_poll(self, title):
        poll = self[title]
        options, usernames = poll

        total_votes = sum(options.values())

        result = PollBot.active_poll + '\n'
        index = 1
        for option in options:
            result += '%s %d. %s (%d votes)\n' % (drawbar(
                poll[0][option], total_votes), index, option, poll[0][option])
            index += 1

        return result.strip()