sequenial-blacklist: Properly read the local file

This commit is contained in:
Anthony Castelli 2014-08-29 11:43:59 -07:00
parent de0d0cafc5
commit c4b994a947
2 changed files with 5 additions and 5 deletions

View file

@ -2,7 +2,7 @@ class SequenceList:
def __init__(self, wordlist): def __init__(self, wordlist):
self.list = {} self.list = {}
for line in wordlist.split('\r\n'): for line in wordlist:
if line is '': if line is '':
continue continue
split = line.split(':') split = line.split(':')

View file

@ -21,7 +21,7 @@ class TTSequenceList(SequenceList):
doc = self.ch.getDocumentSpec() doc = self.ch.getDocumentSpec()
self.ch.getDocument(doc) self.ch.getDocument(doc)
self.ch.downloadToRam(fs) self.ch.downloadToRam(fs)
return fs.getData() return fs.getData().split('\r\n')
def loadSquencesLocally(self): def loadSquencesLocally(self):
vfs = VirtualFileSystem.getGlobalPtr() vfs = VirtualFileSystem.getGlobalPtr()
@ -32,5 +32,5 @@ class TTSequenceList(SequenceList):
if not found: if not found:
self.notify.warning("Couldn't find blacklist sequence data file!") self.notify.warning("Couldn't find blacklist sequence data file!")
return return
data = vfs.readFile(filename, 1) data = vfs.readFile(filename, True)
return data return data.split('\n')