forked from snoopdogg420/src
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the Toontown Fellowship Whitelist Tool! Updated the whitelist
- Loading branch information
1 parent
dffb741
commit 747fa18
Showing
3 changed files
with
75 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo off | ||
python -m whitelist_tool | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import os | ||
os.chdir('../') | ||
|
||
from toontown.chat import WhiteListData | ||
|
||
|
||
def acceptWord(): | ||
word = raw_input('> ').rstrip().lower() | ||
|
||
if word == 'exit()': | ||
saveChanges() | ||
return | ||
|
||
if word in LOCAL_LIST: | ||
print 'The word "%s" is already whitelisted.' % word | ||
else: | ||
LOCAL_LIST.append(word) | ||
print 'Added the word "%s" to the whitelist.' % word | ||
|
||
acceptWord() | ||
|
||
|
||
def saveChanges(): | ||
print 'Saving the whitelist...' | ||
|
||
with open('toontown/chat/WhiteListData.py', 'w') as f: | ||
f.write('WHITELIST = [\n') | ||
|
||
LOCAL_LIST.sort() | ||
addedWords = [] | ||
|
||
for word in LOCAL_LIST: | ||
if word in addedWords: | ||
continue | ||
addedWords.append(word) | ||
|
||
if "'" in word: | ||
f.write(' "%s",\n' % word) | ||
else: | ||
f.write(" '%s',\n" % word) | ||
|
||
f.write(']') | ||
|
||
print 'Your changes have been saved! Make sure to push your changes!' | ||
|
||
|
||
LOCAL_LIST = WhiteListData.WHITELIST | ||
|
||
|
||
print 'Welcome to the Toontown Fellowship Whitelist Tool!' | ||
print 'Type any word you want to add to the whitelist.' | ||
print 'When you are done and want to save your changes, type "exit()"' | ||
|
||
|
||
acceptWord() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters