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


import socket
import ssl
import sys
import events
import urk
import ui
import windows
            import getpass
from conf import conf
    
    # filter out the empty pre-":" tokens and add on the text to the end
    return [m for m in msg[:-1] if m] + msg[-1:]
    
    # note: this sucks and makes very little sense, but it matches the BNF
    #       as far as we've tested, which seems to be the goal

def default_nicks():
    try:
        nicks = [conf.get('nick')] + conf.get('altnicks',[])
        if not nicks[0]:
            nicks = [getpass.getuser()]
    except:
        nicks = ["mrurk"]
    return nicks

class Network(object):
    socket = None
    
    def __init__(self, server="irc.default.org", port=6667, nicks=[], 
                    username="", fullname="", name=None, ssl=None, **kwargs):
        self.server = server
        self.port = port
        
        self.name = name or server
        
        self.nicks = nicks or default_nicks()
        self.me = self.nicks[0]
        
        self.username = username or "urk"

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


# Path: irc.py
import socket
import ssl
import sys
import events
import urk
import ui
import windows
            import getpass
from conf import conf

    
    # filter out the empty pre-":" tokens and add on the text to the end
    return [m for m in msg[:-1] if m] + msg[-1:]
    
    # note: this sucks and makes very little sense, but it matches the BNF
    #       as far as we've tested, which seems to be the goal

def default_nicks():
    try:
        nicks = [conf.get('nick')] + conf.get('altnicks',[])
        if not nicks[0]:
            nicks = [getpass.getuser()]
    except:
        nicks = ["mrurk"]
    return nicks

class Network(object):
    socket = None
    
    def __init__(self, server="irc.default.org", port=6667, nicks=[], 
                    username="", fullname="", name=None, ssl=None, **kwargs):
        self.server = server
        self.port = port
        
        self.name = name or server
        
        self.nicks = nicks or default_nicks()
        self.me = self.nicks[0]
        
        self.username = username or "urk"

        self.fullname = fullname or conf.get("fullname", self.username)