http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11151
Revision: 11151
Author: xqt
Date: 2013-03-02 08:45:43 +0000 (Sat, 02 Mar 2013)
Log Message:
-----------
some PEP8 changes
Modified Paths:
--------------
trunk/pywikipedia/maintenance/readtalk.py
Modified: trunk/pywikipedia/maintenance/readtalk.py
===================================================================
--- trunk/pywikipedia/maintenance/readtalk.py 2013-03-02 08:25:12 UTC (rev
11150)
+++ trunk/pywikipedia/maintenance/readtalk.py 2013-03-02 08:45:43 UTC (rev
11151)
@@ -3,7 +3,8 @@
"""
Tool to read all your talk pages.
-This tool will go through all the normal (not sysop) accounts configured in
user-config and output the contents of the talk page.
+This tool will go through all the normal (not sysop) accounts configured in
+user-config and output the contents of the talk page.
TODO:
*Error checking
@@ -11,10 +12,12 @@
import sys, re
sys.path.append(re.sub('/[^/]*$', '', sys.path[0]))
sys.path.insert(1, '..')
-import wikipedia, config, userlib
+import wikipedia
+import config
+import userlib
-def readtalk(lang, familyName, sysop = False):
+def readtalk(lang, familyName, sysop=False):
site = wikipedia.getSite(code=lang, fam=familyName)
if sysop:
user = userlib.User(site, config.sysopnames[familyName][lang])
@@ -29,12 +32,13 @@
del pagetext
wikipedia.output(u'Reading talk page from %s' % user)
try:
- wikipedia.output( page.get(get_redirect=True)+"\n")
+ wikipedia.output(page.get(get_redirect=True)+"\n")
except wikipedia.NoPage:
wikipedia.output("Talk page is not exist.")
except wikipedia.UserBlocked:
wikipedia.output("Account is blocked.")
+
def main():
# Get a dictionary of all the usernames
all = sysop = False
@@ -44,7 +48,7 @@
all = True
elif arg.startswith('-sysop'):
sysop = True
- if all == True:
+ if all is True:
if sysop:
namedict = config.sysopnames
else:
@@ -60,4 +64,3 @@
main()
finally:
wikipedia.stopme()
-
_______________________________________________
Pywikipedia-svn mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-svn