6
A Message object that holds a few important strings
8
Channel = str() # the channel in which the message was found
9
Time = str() # the time where which the message was sent
10
User = str() # the user who sent the message
11
Message = str() # the message part of the raw line
12
Raw_Message = str() # the raw line unparsed and unchanged
14
def __init__(self, string, filename, *args, **kwargs):
15
self.create_from_string(string, filename)
17
def create_from_string(self, string, filename):
18
self.Raw_Message = string
19
self.Channel = os.path.basename(filename).replace(".log", "")
20
self.Time = string[:15]
21
self.User = string[string.find("<")+1:string.find(">")]
22
self.Message = string[string.find(">")+2:]
25
class XChatMessage(Message):
27
A Message object that holds a few important strings that decodes xchat logs
29
Channel = str() # the channel in which the message was found
30
Time = str() # the time where which the message was sent
31
User = str() # the user who sent the message
32
Message = str() # the message part of the raw line
33
Raw_Message = str() # the raw line unparsed and unchanged
34
xchat = {"TimeCharacters" : 15, "UserSeperators" : ["<",">"]}
36
def __init__(self, string, filename, *args, **kwargs):
37
self.create_from_string(string, filename)
39
def create_from_string(self, string, filename):
40
self.Raw_Message = string
41
self.Channel = os.path.basename(filename).replace(".log", "")
42
self.Time = string[:self.xchat["TimeCharacters"]]
43
self.User = string[string.find(self.xchat["UserSeperators"][0])+1:string.find(self.xchat["UserSeperators"][1])]
44
self.Message = string[string.find(self.xchat["UserSeperators"][1])+2:]
b'\\ No newline at end of file'