[Pywikipedia-l] SVN: [4854] trunk/pywikipedia/checkimages.py

filnik at svn.wikimedia.org filnik at svn.wikimedia.org
Sat Jan 12 12:20:38 UTC 2008


Revision: 4854
Author:   filnik
Date:     2008-01-12 12:20:37 +0000 (Sat, 12 Jan 2008)

Log Message:
-----------
2 Minor Bugfixes for ja and zh wiki

Modified Paths:
--------------
    trunk/pywikipedia/checkimages.py

Modified: trunk/pywikipedia/checkimages.py
===================================================================
--- trunk/pywikipedia/checkimages.py	2008-01-11 13:27:45 UTC (rev 4853)
+++ trunk/pywikipedia/checkimages.py	2008-01-12 12:20:37 UTC (rev 4854)
@@ -209,7 +209,7 @@
 second_message_without_license = {
 				'commons':None,
                                 'en': None,
-				'it':'{{subst:Utente:Filbot/Senza licenza2|%s}} --~~~~',
+				'it':':{{subst:Utente:Filbot/Senza licenza2|%s}} --~~~~',
 				'hu':u'\nSzia! Úgy tűnik a [[:Kép:%s]] képpel is hasonló a probléma, mint az előbbivel. Kérlek olvasd el a [[WP:KÉPLIC|feltölthető képek]]ről szóló oldalunk, és segítségért fordulj a [[WP:KF-JO|Jogi kocsmafalhoz]]. Köszönöm --~~~~',
 				'ja':None,
 				'zh':None,
@@ -217,7 +217,7 @@
 # You can add some settings to wikipedia. In this way, you can change them without touch the code.
 # That's useful if you are running the bot on Toolserver.
 page_with_settings = {
-					'commons':None,
+					'commons':'User:Filbot/Settings',
                                         'en':None,
                                         'hu':None,
 					'it':'Utente:Nikbot/Settings#Settings',
@@ -402,7 +402,7 @@
 		else:
 			commentox = commx
 		if second_text == True:
-			talk_page.put("%s\n\n:%s" % (testoattuale, notification2), comment = commentox, minorEdit = False)
+			talk_page.put("%s\n\n%s" % (testoattuale, notification2), comment = commentox, minorEdit = False)
 		elif second_text == False:
 			talk_page.put(testoattuale + head + notification, comment = commentox, minorEdit = False)
 			
@@ -959,7 +959,16 @@
 						continue
 		# A little block to perform the repeat or to break.
 			if repeat == True:
-				wikipedia.output(u"Waiting for %s seconds, %s" % (time_sleep, time.strftime("%d %b %Y %H:%M:%S (UTC)", time.localtime())))
+                                time_zone = time.strftime("%d %b %Y %H:%M:%S (UTC)", time.localtime())
+                                try:
+                                        wikipedia.output(u"Waiting for %s seconds, %s" % (time_sleep, time_zone))
+                                except UnicodeDecodeError:
+                                        try:
+                                                wikipedia.output(u"Waiting for %s seconds, %s" % (time_sleep, time_zone.decode('utf-8')))
+                                        except Exception, e:
+                                                # There's some strange error! Skip time_zone printing the error.
+                                                print e
+                                                wikipedia.output(u"Waiting for %s seconds")
 				time.sleep(time_sleep)
 			elif repeat == False:
 				wikipedia.output(u"\t\t\t>> STOP! <<")





More information about the Pywikipedia-l mailing list