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()
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()
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()
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()
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()
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()