# Path: foos/utils.py
# def teamName(team):


import foos.config as config
import logging
from foos import utils
        return self.players.get(team, [])

    def get_team_name(self, team):
        players = self.get_players(team)
        if len(players) > 0:
            p = " (" + ", ".join(players) + ")"
        else:
            p = ""

        return utils.teamName(team).capitalize() + p

    def process_event(self, ev):
        msg = None
        if ev.name == 'people_start_playing':
            msg = "People start playing..."
        elif ev.name == 'people_stop_playing':
            msg = "People have left."
        elif ev.name == 'upload_ok':
            msg = "New replay uploaded: " + ev.data
        elif ev.name == "set_players":
            self.players = ev.data
        elif ev.name == "start_competition":
            msg = "%s game starts now: %s" % (ev.data.get("division", ""),
                                              ", ".join(ev.data.get("players", [])))
        elif ev.name == "end_competition":
            ps = sorted(ev.data.get('points', {}).items(), key=lambda x: x[1], reverse=True)
            text = ', '.join(map(lambda x: "%s: %s" % tuple(x), ps))
            msg = "Official game ends, points: " + text
        elif ev.name == "win_game":
            s = "%s wins! %s %d-%d %s!"

# Path: foos/utils.py
# def teamName(team):


# Path: plugins/bot.py
import foos.config as config
import logging
from foos import utils

        return self.players.get(team, [])

    def get_team_name(self, team):
        players = self.get_players(team)
        if len(players) > 0:
            p = " (" + ", ".join(players) + ")"
        else:
            p = ""

        return utils.teamName(team).capitalize() + p

    def process_event(self, ev):
        msg = None
        if ev.name == 'people_start_playing':
            msg = "People start playing..."
        elif ev.name == 'people_stop_playing':
            msg = "People have left."
        elif ev.name == 'upload_ok':
            msg = "New replay uploaded: " + ev.data
        elif ev.name == "set_players":
            self.players = ev.data
        elif ev.name == "start_competition":
            msg = "%s game starts now: %s" % (ev.data.get("division", ""),
                                              ", ".join(ev.data.get("players", [])))
        elif ev.name == "end_competition":
            ps = sorted(ev.data.get('points', {}).items(), key=lambda x: x[1], reverse=True)
            text = ', '.join(map(lambda x: "%s: %s" % tuple(x), ps))
            msg = "Official game ends, points: " + text
        elif ev.name == "win_game":
            s = "%s wins! %s %d-%d %s!"

            msg = (s % (utils.teamName(ev.data.get('team', "")).capitalize(),