Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/92023


Change subject: code improvements:
......................................................................

code improvements:

- replace "pywikibot.config." with "config."
- remove obsolete "return None"

Change-Id: I3ae79965360f2f4bef4f1a77111d8c5c573db982
---
M category.py
1 file changed, 8 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/23/92023/1

diff --git a/category.py b/category.py
index 1b3ad3d..5140314 100644
--- a/category.py
+++ b/category.py
@@ -89,8 +89,8 @@
 # (C) leogregianin, 2004-2008
 # (C) Cyde, 2006-2010
 # (C) Anreas J Schwab, 2007
-# (C) xqt, 2009-2012
-# (C) Pywikipedia team, 2008-2012
+# (C) xqt, 2009-2013
+# (C) Pywikipedia team, 2008-2013
 #
 __version__ = '$Id$'
 #
@@ -139,10 +139,10 @@
         else:
             try:
                 if not os.path.isabs(filename):
-                    filename = pywikibot.config.datafilepath(filename)
+                    filename = config.datafilepath(filename)
                 f = bz2.BZ2File(filename, 'r')
                 pywikibot.output(u'Reading dump from %s'
-                                 % pywikibot.config.shortpath(filename))
+                                 % config.shortpath(filename))
                 databases = pickle.load(f)
                 f.close()
                 # keys are categories, values are 2-tuples with lists as
@@ -207,10 +207,10 @@
 
         '''
         if not os.path.isabs(filename):
-            filename = pywikibot.config.datafilepath(filename)
+            filename = config.datafilepath(filename)
         if self.catContentDB or self.superclassDB:
             pywikibot.output(u'Dumping to %s, please wait...'
-                             % pywikibot.config.shortpath(filename))
+                             % config.shortpath(filename))
             f = bz2.BZ2File(filename, 'w')
             databases = {
                 'catContentDB': self.catContentDB,
@@ -229,7 +229,7 @@
                 pass
             else:
                 pywikibot.output(u'Database is empty. %s removed'
-                                 % pywikibot.config.shortpath(filename))
+                                 % config.shortpath(filename))
 
 
 class AddCategory:
@@ -314,7 +314,6 @@
                                  redirTarget.title(asLink=True)))
         else:
             return text
-        return None
 
     def save(self, text, page, comment, minorEdit=True, botflag=True):
         # only save if something was changed
@@ -833,7 +832,7 @@
         self.catTitle = catTitle
         self.catDB = catDB
         if filename and not os.path.isabs(filename):
-            filename = pywikibot.config.datafilepath(filename)
+            filename = config.datafilepath(filename)
         self.filename = filename
         # TODO: make maxDepth changeable with a parameter or config file entry
         self.maxDepth = maxDepth

-- 
To view, visit https://gerrit.wikimedia.org/r/92023
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ae79965360f2f4bef4f1a77111d8c5c573db982
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to