Revision: 8564
Author: xqt
Date: 2010-09-15 17:16:53 +0000 (Wed, 15 Sep 2010)
Log Message:
-----------
debugging stuff due to bug #3066765; check against int and longint. Seems editTime() is
not valid.
Modified Paths:
--------------
trunk/pywikipedia/clean_sandbox.py
Modified: trunk/pywikipedia/clean_sandbox.py
===================================================================
--- trunk/pywikipedia/clean_sandbox.py 2010-09-15 15:13:57 UTC (rev 8563)
+++ trunk/pywikipedia/clean_sandbox.py 2010-09-15 17:16:53 UTC (rev 8564)
@@ -131,9 +131,9 @@
def run(self):
def minutesDiff(time1, time2):
- if type(time1) is long:
+ if type(time1) in [long, int]:
time1 = str(time1)
- if type(time2) is long:
+ if type(time2) in [long, int]:
time2 = str(time2)
t1 = (((int(time1[0:4]) * 12 + int(time1[4:6])) * 30 +
int(time1[6:8])) * 24 + int(time1[8:10])) * 60 + \
@@ -168,6 +168,8 @@
pywikibot.output(u'Standard content was changed, sandbox
cleaned.')
else:
diff = minutesDiff(sandboxPage.editTime(),
time.strftime("%Y%m%d%H%M%S", time.gmtime()))
+ if pywikibot.verbose:
+ print sandboxPage.editTime(),
time.strftime("%Y%m%d%H%M%S", time.gmtime())
#Is the last edit more than 5 minutes ago?
if diff >= self.delay:
sandboxPage.put(translatedContent, translatedMsg)
Show replies by date