From c4b994a94738ad881513cf7223e16a0442d8cfaf Mon Sep 17 00:00:00 2001 From: Anthony Castelli Date: Fri, 29 Aug 2014 11:43:59 -0700 Subject: [PATCH] sequenial-blacklist: Properly read the local file --- otp/chat/SequenceList.py | 4 ++-- toontown/chat/TTSequenceList.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/otp/chat/SequenceList.py b/otp/chat/SequenceList.py index db7ee804..0021efd3 100644 --- a/otp/chat/SequenceList.py +++ b/otp/chat/SequenceList.py @@ -2,12 +2,12 @@ class SequenceList: def __init__(self, wordlist): self.list = {} - for line in wordlist.split('\r\n'): + for line in wordlist: if line is '': continue split = line.split(':') self.list[split[0].lower()] = [word.rstrip('\r\n').lower() for word in split[1].split(',')] - + def getList(self, word): if word in self.list: return self.list[word] diff --git a/toontown/chat/TTSequenceList.py b/toontown/chat/TTSequenceList.py index 8041da94..bf467501 100644 --- a/toontown/chat/TTSequenceList.py +++ b/toontown/chat/TTSequenceList.py @@ -21,7 +21,7 @@ class TTSequenceList(SequenceList): doc = self.ch.getDocumentSpec() self.ch.getDocument(doc) self.ch.downloadToRam(fs) - return fs.getData() + return fs.getData().split('\r\n') def loadSquencesLocally(self): vfs = VirtualFileSystem.getGlobalPtr() @@ -32,5 +32,5 @@ class TTSequenceList(SequenceList): if not found: self.notify.warning("Couldn't find blacklist sequence data file!") return - data = vfs.readFile(filename, 1) - return data + data = vfs.readFile(filename, True) + return data.split('\n')