コード例 #1
0
ファイル: testme.py プロジェクト: StarlitGhost/MoronBot
from IRCMessage import IRCMessage
from IRCResponse import IRCResponse, ResponseType
from Function import Function
from GlobalVars import *

from enumType import enum

TargetTypes = enum('CHANNEL', 'USER')


class UserStruct:
    Hostmask = ''
    Name = ''
    User = ''

    def __init__(self, dct):
        self.__dict__ = dct


class FakeIRCMessage:
    User = UserStruct({'User': '', 'Name': '', 'Hostmask': ''})
    TargetType = TargetTypes.CHANNEL
    Type = ''
    ReplyTo = ''
    MessageList = []
    MessageString = "<Jimmy> ducttape minecraft!"
    RawMessage = ''
    CTCP = False
    CTCPString = ''
    Parameters = ''
    ParameterList = ['wat']
コード例 #2
0
ファイル: testme.py プロジェクト: MatthewCox/MoronBot
from IRCMessage import IRCMessage
from IRCResponse import IRCResponse, ResponseType
from Function import Function
from GlobalVars import *

from enumType import enum

TargetTypes = enum('CHANNEL', 'USER')

class UserStruct:
    Hostmask = ''
    Name = ''
    User = ''

    def __init__(self, dct):
        self.__dict__ = dct

class FakeIRCMessage:
    User = UserStruct({'User':'','Name':'','Hostmask':''})
    TargetType = TargetTypes.CHANNEL
    Type = ''
    ReplyTo = ''
    MessageList = []
    MessageString = "<Jimmy> ducttape minecraft!"
    RawMessage = ''
    CTCP = False
    CTCPString = ''
    Parameters = ''
    ParameterList = ['wat']
    Command = 'responses'
コード例 #3
0
from enumType import enum

ResponseType = enum('Say', 'Do', 'Notice', 'Raw')


class IRCResponse(object):
    def __init__(self, messageType, response, target):
        self.Type = messageType
        try:
            self.Response = unicode(response, 'utf-8')
        except TypeError:  # Already utf-8?
            self.Response = response
        self.Target = target
コード例 #4
0
ファイル: IRCResponse.py プロジェクト: StarlitGhost/MoronBot
from enumType import enum

ResponseType = enum('Say', 'Do', 'Notice', 'Raw')


class IRCResponse:
    def __init__(self, messageType, response, target):
        self.Type = messageType
        self.Response = response
        self.Target = target
コード例 #5
0
ファイル: IRCResponse.py プロジェクト: pao/Hubbot_Twisted
from enumType import enum

ResponseType = enum("Say", "Do", "Notice", "Raw")


class IRCResponse:
    def __init__(self, messageType, response, target):
        self.Type = messageType
        try:
            self.Response = unicode(response, "utf-8")
        except TypeError:  # Already utf-8?
            self.Response = response
        self.Target = target