# Path: grazyna/irc/models.py
# class WhoisFuture(asyncio.Future):
#     data = None
# 
#     def __init__(self, *args, **kwargs):
#         super().__init__(*args, **kwargs)
#         self.data = WhoisData()


from grazyna.irc.models import WhoisFuture
import asyncio

    def send_msg(self, *args):
        """add ':' to last argument"""
        new_args = list(args)
        new_args[-1] = ':' + str(new_args[-1])
        self.send(*new_args)

    def say(self, nick_chan, msg):
        self.send_msg('PRIVMSG', nick_chan, msg)

    def notice(self, nick, msg):
        self.send_msg('NOTICE', nick, msg)

    def reply(self, nick, msg, chan=None):
        msg = msg if not chan else '%s: %s' % (nick, msg)
        self.say(chan or nick, msg)

    def kick(self, nick, chan, why=''):
        self.send_msg('KICK', chan, nick, why or nick)

    def mode(self, chan, flag, arg):
        self.send('MODE', chan, flag, arg)

    @asyncio.coroutine
    def whois(self, nick):
        """

        :type nick: str
        :return: WhoisData
        """

# Path: grazyna/irc/models.py
# class WhoisFuture(asyncio.Future):
#     data = None
# 
#     def __init__(self, *args, **kwargs):
#         super().__init__(*args, **kwargs)
#         self.data = WhoisData()


# Path: grazyna/irc/sender.py
from grazyna.irc.models import WhoisFuture
import asyncio


    def send_msg(self, *args):
        """add ':' to last argument"""
        new_args = list(args)
        new_args[-1] = ':' + str(new_args[-1])
        self.send(*new_args)

    def say(self, nick_chan, msg):
        self.send_msg('PRIVMSG', nick_chan, msg)

    def notice(self, nick, msg):
        self.send_msg('NOTICE', nick, msg)

    def reply(self, nick, msg, chan=None):
        msg = msg if not chan else '%s: %s' % (nick, msg)
        self.say(chan or nick, msg)

    def kick(self, nick, chan, why=''):
        self.send_msg('KICK', chan, nick, why or nick)

    def mode(self, chan, flag, arg):
        self.send('MODE', chan, flag, arg)

    @asyncio.coroutine
    def whois(self, nick):
        """

        :type nick: str
        :return: WhoisData
        """

        self.whois_heap[nick] = future = WhoisFuture()