# Path: conf.py
# CONF_FILE = os.path.join(urk.userpath,'urk.conf')
# def pprint(obj, depth=-2):
# def save(*args):


import time
import events
import ui
import windows
import irc
    import itertools
        import conf as _conf
    import conf
    import conf
from conf import conf
            
    return url + rurl

#for getting a list of alternative nicks to try on a network
def _nick_generator(network):
    for nick in network.nicks[1:]:
        yield nick
    if network._nick_error:
        nick = 'ircperson'
    else:
        nick = network.nicks[0]
    for i in itertools.count(1):
        for j in xrange(len(NICK_SUFFIX)**i):
            suffix = ''.join(NICK_SUFFIX[(j/(len(NICK_SUFFIX)**x))%len(NICK_SUFFIX)] for x in xrange(i))
            if network._nick_max_length:
                yield nick[0:network._nick_max_length-i]+suffix
            else:
                yield nick+suffix

def setdownRaw(e):
    if not e.done:
        if not e.network.got_nick:
            if e.msg[1] in ('432','433','436','437'): #nickname unavailable
                failednick = e.msg[3]
                nicks = list(e.network.nicks)
                
                if hasattr(e.network,'_nick_generator'):
                    if len(failednick) < len(e.network._next_nick):
                        e.network._nick_max_length = len(failednick)
                    e.network._next_nick = e.network._nick_generator.next()

# Path: conf.py
# CONF_FILE = os.path.join(urk.userpath,'urk.conf')
# def pprint(obj, depth=-2):
# def save(*args):


# Path: scripts/irc_script.py
import time
import events
import ui
import windows
import irc
    import itertools
        import conf as _conf
    import conf
    import conf
from conf import conf

            
    return url + rurl

#for getting a list of alternative nicks to try on a network
def _nick_generator(network):
    for nick in network.nicks[1:]:
        yield nick
    if network._nick_error:
        nick = 'ircperson'
    else:
        nick = network.nicks[0]
    for i in itertools.count(1):
        for j in xrange(len(NICK_SUFFIX)**i):
            suffix = ''.join(NICK_SUFFIX[(j/(len(NICK_SUFFIX)**x))%len(NICK_SUFFIX)] for x in xrange(i))
            if network._nick_max_length:
                yield nick[0:network._nick_max_length-i]+suffix
            else:
                yield nick+suffix

def setdownRaw(e):
    if not e.done:
        if not e.network.got_nick:
            if e.msg[1] in ('432','433','436','437'): #nickname unavailable
                failednick = e.msg[3]
                nicks = list(e.network.nicks)
                
                if hasattr(e.network,'_nick_generator'):
                    if len(failednick) < len(e.network._next_nick):
                        e.network._nick_max_length = len(failednick)
                    e.network._next_nick = e.network._nick_generator.next()

                    e.network.raw('NICK %s' % e.network._next_nick)