Revision: 4958
Author: filnik
Date: 2008-02-01 20:13:51 +0000 (Fri, 01 Feb 2008)
Log Message:
-----------
I've seen that the whitelist wasn't working correctly (or wasn't working at all), bugfixed.
Modified Paths:
--------------
trunk/pywikipedia/welcome.py
Modified: trunk/pywikipedia/welcome.py
===================================================================
--- trunk/pywikipedia/welcome.py 2008-01-31 17:23:45 UTC (rev 4957)
+++ trunk/pywikipedia/welcome.py 2008-02-01 20:13:51 UTC (rev 4958)
@@ -718,18 +718,22 @@
if filter_wp == True:
# That is the default whitelist (it contains few name because it has been improved in the latest days..).
whitelist_default = ['emiliano']
- whitelist_page = wikipedia.Page(wsite, wtlpg)
- if whitelist_page.exists():
- wikipedia.output(u'\nLoading the whitelist from %s...' % wsite.hostname() )
- text_white = whitelist_page.get()
- list_white = load_word_function(wsite,text_white)
+ if wtlpg != None:
+ whitelist_page = wikipedia.Page(wsite, wtlpg)
+ if whitelist_page.exists():
+ wikipedia.output(u'\nLoading the whitelist from %s...' % wsite.hostname() )
+ text_white = whitelist_page.get()
+ list_white = load_word_function(wsite, text_white)
+ else:
+ wikipedia.output(u"\t\t>>>WARNING: The whitelist's page doesn't exist!<<<")
+ list_white = list()
else:
- wikipedia.output(u"\t\t>>>WARNING: The whitelist's page doesn't exist!<<<")
+ wikipedia.output(u"\t\t>>>WARNING: The whitelist hasn't been setted!<<<")
list_white = list()
else:
list_white = list()
whitelist_default = list()
- # Joined the whitelist words.
+ # Join the whitelist words.
whitelist = list_white + whitelist_default
# List of words that the bot understands when it asks the operator for input.
block = ("B", "b", "Blocco", "blocco", "block", "bloc", "Block", "Bloc", 'Report', 'report')
@@ -787,6 +791,7 @@
break
else:
final_rep = rep_text
+ break
# Checking in the whitelist...
for xy in whitelist:
if xy.lower() in username.lower():
@@ -794,10 +799,12 @@
for word in elenco:
if word.lower() in username.lower():
baduser = True
+ break
else:
baduser = False
+ break
# He has a badusername, trying to report him...
- if baduser == True:
+ if baduser:
while 1:
if ask == True:
wikipedia.output(u'%s may have an unwanted username, what shall i do?' % username )