mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Whitelist tool update
This commit is contained in:
parent
519a4fd111
commit
6b275d17db
1 changed files with 12 additions and 2 deletions
|
@ -38,6 +38,11 @@ def acceptWord():
|
||||||
|
|
||||||
acceptWord()
|
acceptWord()
|
||||||
|
|
||||||
|
def removeDuplicates(list):
|
||||||
|
seen = set()
|
||||||
|
seen_add = seen.add
|
||||||
|
return [x for x in list if not (x in seen or seen_add(x))]
|
||||||
|
|
||||||
def saveChanges():
|
def saveChanges():
|
||||||
global LOCAL_LIST
|
global LOCAL_LIST
|
||||||
print 'Saving the whitelist...'
|
print 'Saving the whitelist...'
|
||||||
|
@ -46,11 +51,16 @@ def saveChanges():
|
||||||
f.write('WHITELIST = [\n')
|
f.write('WHITELIST = [\n')
|
||||||
|
|
||||||
LOCAL_LIST.sort()
|
LOCAL_LIST.sort()
|
||||||
LOCAL_LIST = list(set(LOCAL_LIST)) # Remove duplicates
|
LOCAL_LIST = removeDuplicates(LOCAL_LIST)
|
||||||
addedWords = []
|
addedWords = []
|
||||||
|
|
||||||
for word in LOCAL_LIST:
|
for word in LOCAL_LIST:
|
||||||
if word in addedWords:
|
|
||||||
|
if word in addedWords or word.contains('\\'):
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
word.decode('ascii')
|
||||||
|
except:
|
||||||
continue
|
continue
|
||||||
addedWords.append(word)
|
addedWords.append(word)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue