def __init__(self, theNick, theRoom, theCommand, isPm=0): Command.Command.__init__(self, theNick, theRoom, theCommand, isPm) self.commands = { "spam": {"method": BayesCommand.trainSpam, "acl": 1, "aclkey": Acl.TRAINSPAM}, "ham": {"method": BayesCommand.trainHam, "acl": 1, "aclkey": Acl.TRAINHAM}, "hammer": {"method": BayesCommand.addHammer, "acl": 1, "aclkey": Acl.HAMMER}, "spammer": {"method": BayesCommand.addSpammer, "acl": 1, "aclkey": Acl.SPAMMER}, "probability": {"method": BayesCommand.probability, "acl": 1, "aclkey": Acl.SPAMPROBABILITY}, } self.spamFilter = SpamFilter.getInstance()
protocol = config.getString("login", "protocol") #init the protocol we are going to use Protocol.initProtocol( protocol ) protocol = Protocol.getProtocol() #first get the cookie and id's nick = config.getString( "login", "username" ) passwd = config.getString( "login", "password" ) events = Events.getEvents() events.addListener( Display.getDisplay() ) events.addListener( SpamFilter.getInstance() ) #create the socket sock = socket.socket( socket.AF_INET, socket.SOCK_STREAM ) sock.settimeout( 120.0 ) chatserver = config.getString( "login", "chatserver" ) chatport = config.getInt( "login", "chatport" ) #recreate the acl? if sys.argv.count( "-newacl" ): os.unlink( Acl.ACLFILE ) chatRoom = config.getString( "login", "chatroom" ) if len( sys.argv ) > 1: