# Path: grazyna/irc/exc.py
# class NoSuchNickError(Exception):
#     nick = None
#     
#     def __init__(self, nick):
#         self.nick = nick
# 
#     def __repr__(self):
#         return 'NoSuchNickError(%s)' % self.nick
# 
#     def __str__(self):
#         return repr(self)
# 
#     def __eq__(self, other):
#         return self.nick == other.nick
# 
# Path: grazyna/irc/models.py
# class User(object):
#     """User class - has nick, realname, and host"""
#     nick = ""
#     host = ""
#     realname = ""
# 
#     def __init__(self, prefix):
#         try:
#             self.nick, _, name_host = prefix.partition('!')
#             self.realname, _, self.host = name_host.partition('@')
#         except:
#             pass
# 
#     @property
#     def prefix(self):
#         return "%s@%s" % (self.realname, self.host)
# 
#     def __repr__(self):
#         return "User('%s!%s')" % (self.nick, self.prefix)
# 
#     def __eq__(self, other):
#         if not isinstance(other, type(self)):
#             return False
# 
#         return (
#             self.nick == other.nick
#             and self.realname == other.realname
#             and self.host == other.host
#         )


from functools import wraps
from datetime import datetime
from asyncio import async
from grazyna.irc.exc import NoSuchNickError
from grazyna.irc.models import User
import os.path
import asyncio

    def command_start(self):
        if self.protocol.ready:
            return

        self.protocol.ready = True
        async(ping_pong(self.protocol))

        for channel in self.protocol.config.getlist('main', 'channels'):
            self.protocol.send('JOIN', channel)

        kwargs = dict(self.protocol.config.items('auth'))
        del kwargs['module']
        cls_auther = self.protocol.config.getmodule('auth', 'module')
        cls_auther(**kwargs).auth(self.protocol)

    @whois_command
    def command_whois_account(self, whois_data):
        whois_data.account = self.data[4]

    @whois_command
    def command_whois_user(self, whois_data):
        nick, realname, host, _, ircname = self.data[3:8]
        whois_data.nick = nick
        whois_data.host = host
        whois_data.realname = realname
        whois_data.ircname = ircname

    @whois_command
    def command_whois_server(self, whois_data):

# Path: grazyna/irc/exc.py
# class NoSuchNickError(Exception):
#     nick = None
#     
#     def __init__(self, nick):
#         self.nick = nick
# 
#     def __repr__(self):
#         return 'NoSuchNickError(%s)' % self.nick
# 
#     def __str__(self):
#         return repr(self)
# 
#     def __eq__(self, other):
#         return self.nick == other.nick
# 
# Path: grazyna/irc/models.py
# class User(object):
#     """User class - has nick, realname, and host"""
#     nick = ""
#     host = ""
#     realname = ""
# 
#     def __init__(self, prefix):
#         try:
#             self.nick, _, name_host = prefix.partition('!')
#             self.realname, _, self.host = name_host.partition('@')
#         except:
#             pass
# 
#     @property
#     def prefix(self):
#         return "%s@%s" % (self.realname, self.host)
# 
#     def __repr__(self):
#         return "User('%s!%s')" % (self.nick, self.prefix)
# 
#     def __eq__(self, other):
#         if not isinstance(other, type(self)):
#             return False
# 
#         return (
#             self.nick == other.nick
#             and self.realname == other.realname
#             and self.host == other.host
#         )


# Path: grazyna/irc/message_controller.py
from functools import wraps
from datetime import datetime
from asyncio import async
from grazyna.irc.exc import NoSuchNickError
from grazyna.irc.models import User
import os.path
import asyncio


    def command_start(self):
        if self.protocol.ready:
            return

        self.protocol.ready = True
        async(ping_pong(self.protocol))

        for channel in self.protocol.config.getlist('main', 'channels'):
            self.protocol.send('JOIN', channel)

        kwargs = dict(self.protocol.config.items('auth'))
        del kwargs['module']
        cls_auther = self.protocol.config.getmodule('auth', 'module')
        cls_auther(**kwargs).auth(self.protocol)

    @whois_command
    def command_whois_account(self, whois_data):
        whois_data.account = self.data[4]

    @whois_command
    def command_whois_user(self, whois_data):
        nick, realname, host, _, ircname = self.data[3:8]
        whois_data.nick = nick
        whois_data.host = host
        whois_data.realname = realname
        whois_data.ircname = ircname

    @whois_command
    def command_whois_server(self, whois_data):

        whois_data.server = self.data[4]