Revision: 7644 Author: misza13 Date: 2009-11-13 17:06:59 +0000 (Fri, 13 Nov 2009)
Log Message: ----------- Adding a few fixes from local copy (handling of unusual cases)
Modified Paths: -------------- trunk/pywikipedia/archivebot.py
Modified: trunk/pywikipedia/archivebot.py =================================================================== --- trunk/pywikipedia/archivebot.py 2009-11-13 12:58:33 UTC (rev 7643) +++ trunk/pywikipedia/archivebot.py 2009-11-13 17:06:59 UTC (rev 7644) @@ -170,14 +170,14 @@ 'B' (bytes) or 'T' (threads).""" if str[-1] in string.digits: #TODO: de-uglify return (int(str),'B') - elif str[-1] == 'K': + elif str[-1] in ['K', 'k']: return (int(str[:-1])*1024,'B') elif str[-1] == 'M': return (int(str[:-1])*1024*1024,'B') elif str[-1] == 'T': return (int(str[:-1]),'T') else: - return (0,'B') + return (int(str[:-1])*1024,'B')
def int2month(num): @@ -597,8 +597,6 @@ except: wikipedia.output(u'Error occured while processing page [[%s]]' % pg.title()) traceback.print_exc() - else: - wikipedia.showHelp("archivebot")
if __name__ == '__main__':