Esempio n. 1
0
File: text.py Progetto: rp-/honstats
    def playerheroesinfo(self, ids, statstype, sort_by, order, arglimit):
        output = ''
        for id_ in ids:
            data = self.dp.fetchplayer(id_, statstype)
            nickname = self.dp.id2nick(int(data['account_id']))
            player = Player(nickname, data)
            stats = player.playerheroes(self.dp, statstype, sort_by, order)

            limit = arglimit if arglimit else len(stats)
            output += self.dp.id2nick(id_) + '\n'
            output += Player.PlayerHeroHeader + '\n'
            for i in range(limit):
                stat = stats[i]
                stat['hero'] = self.dp.heroid2name(stat['heroid'])[:10]
                output += Player.PlayerHeroFormat.format(**stat) + '\n'

        return output