sequenial-blacklist: Properly read the local file
This commit is contained in:
parent
de0d0cafc5
commit
c4b994a947
2 changed files with 5 additions and 5 deletions
|
@ -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]
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue