Revision: 4118 Author: btongminh Date: 2007-08-26 21:36:18 +0000 (Sun, 26 Aug 2007)
Log Message: ----------- Some fixes for local use.
Modified Paths: -------------- trunk/pywikipedia/checkusage.py trunk/pywikipedia/delinker.py
Modified: trunk/pywikipedia/checkusage.py =================================================================== --- trunk/pywikipedia/checkusage.py 2007-08-26 20:27:34 UTC (rev 4117) +++ trunk/pywikipedia/checkusage.py 2007-08-26 21:36:18 UTC (rev 4118) @@ -224,6 +224,10 @@ mysql_max_retries = -1, mysql_callback = lambda *args: None): self.http = None + self.http_retry_timeout = http_retry_timeout + self.http_max_retries = http_max_retries + self.http_callback = http_callback + if no_db: return
self.mysql_host_prefix = mysql_host_prefix @@ -234,10 +238,6 @@ self.mysql_max_retries = mysql_max_retries self.mysql_callback = mysql_callback - self.http_retry_timeout = http_retry_timeout - self.http_max_retries = http_max_retries - self.http_callback = http_callback - self.connections = [] # Mapping database name -> mysql connection
Modified: trunk/pywikipedia/delinker.py =================================================================== --- trunk/pywikipedia/delinker.py 2007-08-26 20:27:34 UTC (rev 4117) +++ trunk/pywikipedia/delinker.py 2007-08-26 21:36:18 UTC (rev 4118) @@ -398,14 +398,15 @@ # without the image itself. Can be fixed by querying query.php # instead of api.php. Also should this be made as an exits() # method of checkusage.CheckUsage? - shared_image_repository = self.CommonsDelinker.get_site(*self.site.shared_image_repository()) - try: - if self.CheckUsage.exists(shared_image_repository, image) \ - and not bool(replacement): - output(u'%s %s exists on the shared image repository!' % (self, image)) - return - finally: - self.CommonsDelinker.unlock_site(shared_image_repository) + if self.site.shared_image_repository() != (None, None): + shared_image_repository = self.CommonsDelinker.get_site(*self.site.shared_image_repository()) + try: + if self.CheckUsage.exists(shared_image_repository, image) \ + and not bool(replacement): + output(u'%s %s exists on the shared image repository!' % (self, image)) + return + finally: + self.CommonsDelinker.unlock_site(shared_image_repository) if self.CheckUsage.exists(self.site, image) and \ not bool(replacement): output(u'%s %s exists again!' % (self, image))
pywikipedia-l@lists.wikimedia.org