Revision: 8743
Author:   xqt
Date:     2010-11-25 12:15:11 +0000 (Thu, 25 Nov 2010)
Log Message:
-----------
classmethod decorator for getCommonscatTemplate(); fix for r8546

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

Modified: trunk/pywikipedia/commonscat.py
===================================================================
--- trunk/pywikipedia/commonscat.py     2010-11-23 08:14:23 UTC (rev 8742)
+++ trunk/pywikipedia/commonscat.py     2010-11-25 12:15:11 UTC (rev 8743)
@@ -257,12 +257,12 @@
                         return True
         return False
 
+    @classmethod
+    def getCommonscatTemplate (self, lang=None):
+        '''Get the template name in a language. Expects the language code.
+        Return as tuple containing the primary template and it's alternatives
 
-    def getCommonscatTemplate (self, lang = None):
         '''
-        Get the template name in a language. Expects the language code.
-        Return as tuple containing the primary template and it's alternatives
-        '''
         if lang in commonscatTemplates:
             return  commonscatTemplates[lang]
         else:
@@ -514,8 +514,9 @@
                 summary = arg[9:]
         elif arg.startswith('-checkcurrent'):
             checkcurrent = True
-            primaryCommonscat, commonscatAlternatives = getCommonscatTemplate(
-                pywikibot.getSite().language())
+            primaryCommonscat, commonscatAlternatives = \
+                               CommonscatBot.getCommonscatTemplate(
+                                   pywikibot.getSite().language())
             generator = pagegenerators.NamespaceFilterPageGenerator(
                 pagegenerators.ReferringPageGenerator(
                     pywikibot.Page(pywikibot.getSite(),


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

Reply via email to