# Path: pyspades/constants.py
# MAX_CHAT_SIZE = 90 # more like 95, but just to make sure
# 
# Path: pyspades/types.py
# class AttributeSet(set):
#     """
#     set with attribute access, i.e.
#     
#         foo = AttributeSet()
#         foo.bar = True
#         foo.bar == 'bar' in foo == True
#         foo.bar = False
#         foo.bar == 'bar' in foo == False
#     
#     This works as a quick shorthand for membership testing.
#     """
#     
#     def __getattr__(self, name):
#         return name in self
#     
#     def __setattr__(self, name, value):
#         if value:
#             self.add(name)
#         else:
#             self.discard(name)


from twisted.words.protocols import irc
from twisted.internet import reactor, protocol
from pyspades.constants import MAX_CHAT_SIZE
from pyspades.common import encode, decode
from pyspades.types import AttributeSet
from itertools import groupby, chain, izip
from operator import attrgetter
import commands
import random
import string

            name_count = len(names)
            noun = 'player' if name_count == 1 else 'players'
            msg = 'has %s %s in %s: ' % (name_count, noun, team.name)
            msg += separator.join(names)
            connection.me(msg)

@irc
def score(connection):
    connection.me("scores: Blue %s - Green %s" % (
        connection.protocol.blue_team.score,
        connection.protocol.green_team.score))

@irc
def alias(connection, value = None):
    aliases = connection.factory.aliases
    unaliased_name = connection.unaliased_name
    if value is None:
        alias = aliases.get(unaliased_name)
        if alias:
            message = 'aliases %s to %s' % (unaliased_name, alias)
        else:
            message = "doesn't have an alias for %s" % unaliased_name
    else:
        aliases[unaliased_name] = value
        message = 'will alias %s to %s' % (unaliased_name, value)
    connection.me(message)

@irc
def unalias(connection):
    aliases = connection.factory.aliases

# Path: pyspades/constants.py
# MAX_CHAT_SIZE = 90 # more like 95, but just to make sure
# 
# Path: pyspades/types.py
# class AttributeSet(set):
#     """
#     set with attribute access, i.e.
#     
#         foo = AttributeSet()
#         foo.bar = True
#         foo.bar == 'bar' in foo == True
#         foo.bar = False
#         foo.bar == 'bar' in foo == False
#     
#     This works as a quick shorthand for membership testing.
#     """
#     
#     def __getattr__(self, name):
#         return name in self
#     
#     def __setattr__(self, name, value):
#         if value:
#             self.add(name)
#         else:
#             self.discard(name)


# Path: feature_server/irc.py
from twisted.words.protocols import irc
from twisted.internet import reactor, protocol
from pyspades.constants import MAX_CHAT_SIZE
from pyspades.common import encode, decode
from pyspades.types import AttributeSet
from itertools import groupby, chain, izip
from operator import attrgetter
import commands
import random
import string

            name_count = len(names)
            noun = 'player' if name_count == 1 else 'players'
            msg = 'has %s %s in %s: ' % (name_count, noun, team.name)
            msg += separator.join(names)
            connection.me(msg)

@irc
def score(connection):
    connection.me("scores: Blue %s - Green %s" % (
        connection.protocol.blue_team.score,
        connection.protocol.green_team.score))

@irc
def alias(connection, value = None):
    aliases = connection.factory.aliases
    unaliased_name = connection.unaliased_name
    if value is None:
        alias = aliases.get(unaliased_name)
        if alias:
            message = 'aliases %s to %s' % (unaliased_name, alias)
        else:
            message = "doesn't have an alias for %s" % unaliased_name
    else:
        aliases[unaliased_name] = value
        message = 'will alias %s to %s' % (unaliased_name, value)
    connection.me(message)

@irc
def unalias(connection):
    aliases = connection.factory.aliases

    unaliased_name = connection.unaliased_name
