[Pywikipedia-svn] SVN: [7215] trunk/pywikipedia/speedy_delete.py
alexsh at svn.wikimedia.org
alexsh at svn.wikimedia.org
Sun Sep 6 15:43:00 UTC 2009
Revision: 7215
Author: alexsh
Date: 2009-09-06 15:42:59 +0000 (Sun, 06 Sep 2009)
Log Message:
-----------
*speedy_delete.py: show only first 5Kb detail if pageText too large (> 20K)
Modified Paths:
--------------
trunk/pywikipedia/speedy_delete.py
Modified: trunk/pywikipedia/speedy_delete.py
===================================================================
--- trunk/pywikipedia/speedy_delete.py 2009-09-06 14:16:31 UTC (rev 7214)
+++ trunk/pywikipedia/speedy_delete.py 2009-09-06 15:42:59 UTC (rev 7215)
@@ -447,7 +447,7 @@
"""
self.mySite = wikipedia.getSite()
self.csdCat = catlib.Category(self.mySite, wikipedia.translate(self.mySite, self.csd_cat))
- self.savedProgress = '!'
+ self.savedProgress = None
self.preloadingGen = None
def guessReasonForDeletion(self, page):
@@ -509,7 +509,7 @@
startFromBeginning = True
while keepGoing:
if startFromBeginning:
- self.savedProgress = '!'
+ self.savedProgress = None
self.refreshGenerator()
count = 0
for page in self.preloadingGen:
@@ -523,7 +523,12 @@
# Highlight the title in purple.
wikipedia.output(u"\n\n>>> \03{lightpurple}%s\03{default} <<<" % page.title())
wikipedia.output(u'- - - - - - - - - ')
- wikipedia.output(pageText)
+ if len(pageText) > 20000:
+ wikipedia.output('The page detail is too large, only output first 5K detail:')
+ wikipedia.output(u'- - - - - - - - - ')
+ wikipedia.output(pageText[:5000])
+ else:
+ wikipedia.output(pageText)
wikipedia.output(u'- - - - - - - - - ')
choice = wikipedia.inputChoice(u'Input action?', ['delete', 'skip', 'update', 'quit'], ['d', 'S', 'u', 'q'], 'S')
if choice == 'q':
More information about the Pywikipedia-svn
mailing list