http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11425

Revision: 11425
Author:   drtrigon
Date:     2013-04-21 19:09:15 +0000 (Sun, 21 Apr 2013)
Log Message:
-----------
improvement; remove obsolete variable (from rewrite)

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

Modified: trunk/pywikipedia/clean_sandbox.py
===================================================================
--- trunk/pywikipedia/clean_sandbox.py  2013-04-21 19:07:33 UTC (rev 11424)
+++ trunk/pywikipedia/clean_sandbox.py  2013-04-21 19:09:15 UTC (rev 11425)
@@ -160,28 +160,27 @@
                    int(time2[10:12])
             return abs(t2-t1)
 
-        mySite = self.site
         while True:
             wait = False
             now = time.strftime("%d %b %Y %H:%M:%S (UTC)", time.gmtime())
-            localSandboxTitle = pywikibot.translate(mySite, sandboxTitle)
+            localSandboxTitle = pywikibot.translate(self.site, sandboxTitle)
             if type(localSandboxTitle) is list:
                 titles = localSandboxTitle
             else:
                 titles = [localSandboxTitle,]
             for title in titles:
-                sandboxPage = pywikibot.Page(mySite, title)
+                sandboxPage = pywikibot.Page(self.site, title)
                 pywikibot.output(u'Preparing to process sandbox page %s' % 
sandboxPage.title(asLink=True))
                 try:
                     text = sandboxPage.get()
-                    translatedContent = pywikibot.translate(mySite, content)
-                    translatedMsg = i18n.twtranslate(mySite,
+                    translatedContent = pywikibot.translate(self.site, content)
+                    translatedMsg = i18n.twtranslate(self.site,
                                                      'clean_sandbox-cleaned')
                     subst = 'subst:' in translatedContent
                     pos = text.find(translatedContent.strip())
                     if text.strip() == translatedContent.strip():
                         pywikibot.output(u'The sandbox is still clean, no 
change necessary.')
-                    elif subst and sandboxPage.userName() == 
mySite.loggedInAs():
+                    elif subst and sandboxPage.userName() == 
self.site.loggedInAs():
                         pywikibot.output(u'The sandbox might be clean, no 
change necessary.')
                     elif pos <> 0 and not subst:
                         if self.user:


_______________________________________________
Pywikipedia-svn mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-svn

Reply via email to