# Path: pyGBot/log.py
# def addScreenHandler(logobj, format):
# def addLogFileHandler(logobj, filename, format):
# 
# Path: pyGBot/format.py
# NUL = chr(0)
# CR = chr(0x0D)
# NL = chr(0x0A)
# LF = NL
# CRLF = CR + LF
# SPC = chr(0x20) # space
# BOLD = chr(2)
# COLOR = chr(3)
# ITALIC = chr(0x16)
# REV = ITALIC # reversed colors - italic or reversed display is client-dependent
# UNDER = chr(0x1f)
# CLEAR = chr(0x0f)
# RE_COLOR  = re.compile(r'\x03(\d{1,2}(,\d{1,2})?)?')
# RE_FORMAT = re.compile('|'.join([BOLD, COLOR, ITALIC, UNDER, CLEAR]))
# def strip(msg):
# def stripcolors(msg):
# def color(fg=None, bg=None):
# def encodeOut(msg):
# def decodeIn(msg):
# 
# Path: pyGBot/PluginEvents.py
# class PluginEvents(Events):
#     __events__ = ('user_join','user_part','user_kicked','user_quit','user_nickchange',
#                   'bot_connect', 'bot_join', 'bot_kicked','bot_disconnect',
#                   'msg_channel', 'msg_action', 'msg_private', 'msg_notice',
#                   'channel_names', 'channel_topic', 'timer_tick')


from contrib.configobj import ConfigObj, ConfigObjError
from pyGBot import log, format
from pyGBot.PluginEvents import PluginEvents
    from twisted import __version__ as twistedversion
    from twisted.protocols import irc
    from twisted.words.protocols import irc
from twisted.internet import reactor, protocol, task
            from twisted.internet import ssl
import sys
import time
import threading
import logging
        # Call Event Handler
        self.events.user_quit(userIn, quitMsgIn)

    def userRenamed(self, oldname, newname):
        """Called when the bot sees a user change their nickname from oldname to
        newname. """
        oldnameIn = format.decodeIn(oldname)
        newnameIn = format.decodeIn(newname)
        log.chatlog.info('%s is now known as %s' % (oldname, newname))
        # Call Event Handler
        self.events.user_nickchange(oldnameIn, newnameIn)

class GBotFactory(protocol.ClientFactory):
    """A factory for tbots.

    A new protocol instance is created each time we connect to the server.
    """

    # the class of the protocol to build when new connection is made
    protocol = GBot

    def __init__(self, channels, filename):
        self.channels = channels
        self.filename = filename
        self.connector = None
        conf = ConfigObj('pyGBot.ini')

        # Open GBot log
        try:
            print "Opening pyGBot log file..."

# Path: pyGBot/log.py
# def addScreenHandler(logobj, format):
# def addLogFileHandler(logobj, filename, format):
# 
# Path: pyGBot/format.py
# NUL = chr(0)
# CR = chr(0x0D)
# NL = chr(0x0A)
# LF = NL
# CRLF = CR + LF
# SPC = chr(0x20) # space
# BOLD = chr(2)
# COLOR = chr(3)
# ITALIC = chr(0x16)
# REV = ITALIC # reversed colors - italic or reversed display is client-dependent
# UNDER = chr(0x1f)
# CLEAR = chr(0x0f)
# RE_COLOR  = re.compile(r'\x03(\d{1,2}(,\d{1,2})?)?')
# RE_FORMAT = re.compile('|'.join([BOLD, COLOR, ITALIC, UNDER, CLEAR]))
# def strip(msg):
# def stripcolors(msg):
# def color(fg=None, bg=None):
# def encodeOut(msg):
# def decodeIn(msg):
# 
# Path: pyGBot/PluginEvents.py
# class PluginEvents(Events):
#     __events__ = ('user_join','user_part','user_kicked','user_quit','user_nickchange',
#                   'bot_connect', 'bot_join', 'bot_kicked','bot_disconnect',
#                   'msg_channel', 'msg_action', 'msg_private', 'msg_notice',
#                   'channel_names', 'channel_topic', 'timer_tick')


# Path: pyGBot/core.py
from contrib.configobj import ConfigObj, ConfigObjError
from pyGBot import log, format
from pyGBot.PluginEvents import PluginEvents
    from twisted import __version__ as twistedversion
    from twisted.protocols import irc
    from twisted.words.protocols import irc
from twisted.internet import reactor, protocol, task
            from twisted.internet import ssl
import sys
import time
import threading
import logging

        # Call Event Handler
        self.events.user_quit(userIn, quitMsgIn)

    def userRenamed(self, oldname, newname):
        """Called when the bot sees a user change their nickname from oldname to
        newname. """
        oldnameIn = format.decodeIn(oldname)
        newnameIn = format.decodeIn(newname)
        log.chatlog.info('%s is now known as %s' % (oldname, newname))
        # Call Event Handler
        self.events.user_nickchange(oldnameIn, newnameIn)

class GBotFactory(protocol.ClientFactory):
    """A factory for tbots.

    A new protocol instance is created each time we connect to the server.
    """

    # the class of the protocol to build when new connection is made
    protocol = GBot

    def __init__(self, channels, filename):
        self.channels = channels
        self.filename = filename
        self.connector = None
        conf = ConfigObj('pyGBot.ini')

        # Open GBot log
        try:
            print "Opening pyGBot log file..."

            log.addScreenHandler(log.logger, log.formatter)