# 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
#    'mode':0, #this is commonly used for channels, but can apply to users
#    'names':0, #with no parameters, this is supposed to give a list of all users; we may be able to safely ignore that.
    }
    
def setupCommand(e):
    if not e.done: 
        if e.name in needschan and isinstance(e.window, windows.ChannelWindow):
            valid_chan_prefixes = e.network.isupport.get('CHANTYPES', '#&+')
            chan_pos = needschan[e.name]
            
            if len(e.args) > chan_pos:
                if not e.args[chan_pos] or e.args[chan_pos][0] not in valid_chan_prefixes:
                    e.args.insert(chan_pos, e.window.id)
            else:
                e.args.append(e.window.id)
        
        if e.name in trailing:
            trailing_pos = trailing[e.name]
        
            if len(e.args) > trailing_pos:
                e.args[trailing_pos] = ':%s' % e.args[trailing_pos]
        
        e.text = '%s %s' % (e.name, ' '.join(e.args))

def setdownCommand(e):
    if not e.done and e.network.status >= irc.INITIALIZING:
        e.network.raw(e.text)
        e.done = True
        
def get_network_info(name, network_info):

# 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

#    'mode':0, #this is commonly used for channels, but can apply to users
#    'names':0, #with no parameters, this is supposed to give a list of all users; we may be able to safely ignore that.
    }
    
def setupCommand(e):
    if not e.done: 
        if e.name in needschan and isinstance(e.window, windows.ChannelWindow):
            valid_chan_prefixes = e.network.isupport.get('CHANTYPES', '#&+')
            chan_pos = needschan[e.name]
            
            if len(e.args) > chan_pos:
                if not e.args[chan_pos] or e.args[chan_pos][0] not in valid_chan_prefixes:
                    e.args.insert(chan_pos, e.window.id)
            else:
                e.args.append(e.window.id)
        
        if e.name in trailing:
            trailing_pos = trailing[e.name]
        
            if len(e.args) > trailing_pos:
                e.args[trailing_pos] = ':%s' % e.args[trailing_pos]
        
        e.text = '%s %s' % (e.name, ' '.join(e.args))

def setdownCommand(e):
    if not e.done and e.network.status >= irc.INITIALIZING:
        e.network.raw(e.text)
        e.done = True
        
def get_network_info(name, network_info):

    conf_info = conf.get('networks', {}).get(name)