# 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

    def userKicked(self, kickee, channel, kicker, message):
        self.userLeft(kickee, channel)
    
    def send(self, msg, filter = False):
        msg = msg.encode('cp1252', 'replace')
        if filter:
            msg = filter_printable(msg)
        self.msg(self.factory.channel, msg)
    
    def me(self, msg, filter = False):
        msg = msg.encode('cp1252', 'replace')
        if filter:
            msg = filter_printable(msg)
        self.describe(self.factory.channel, msg)

class IRCClientFactory(protocol.ClientFactory):
    protocol = IRCBot
    lost_reconnect_delay = 20
    failed_reconnect_delay = 60
    bot = None
    aliases = None
    colors = True
    admin = None
    user_types = None
    rights = None
    
    def __init__(self, server, config):
        self.aliases = {}
        self.admin = True
        self.user_types = AttributeSet(['admin', 'irc'])

# 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

    def userKicked(self, kickee, channel, kicker, message):
        self.userLeft(kickee, channel)
    
    def send(self, msg, filter = False):
        msg = msg.encode('cp1252', 'replace')
        if filter:
            msg = filter_printable(msg)
        self.msg(self.factory.channel, msg)
    
    def me(self, msg, filter = False):
        msg = msg.encode('cp1252', 'replace')
        if filter:
            msg = filter_printable(msg)
        self.describe(self.factory.channel, msg)

class IRCClientFactory(protocol.ClientFactory):
    protocol = IRCBot
    lost_reconnect_delay = 20
    failed_reconnect_delay = 60
    bot = None
    aliases = None
    colors = True
    admin = None
    user_types = None
    rights = None
    
    def __init__(self, server, config):
        self.aliases = {}
        self.admin = True
        self.user_types = AttributeSet(['admin', 'irc'])

        self.rights = AttributeSet()
