Ricordisamoa has uploaded a new change for review.

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

Change subject: Deprecate everything in compat.catlib and compat.userlib
......................................................................

Deprecate everything in compat.catlib and compat.userlib

Id est:
* compat.catlib.Category
* compat.catlib.change_category()
* compat.userlib.User

The 'compat' submodule was never meant for direct use, but
a real deprecation notice has never been added.
Since replacing them with their 'core' equivalents is a
no-brainer, they will be removed quite soon.

Change-Id: Iaa29035d8f645724c4a5d09d90e64e03f2823f9a
---
M pywikibot/compat/catlib.py
M pywikibot/compat/userlib.py
2 files changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/77/178577/1

diff --git a/pywikibot/compat/catlib.py b/pywikibot/compat/catlib.py
index 985f6af..d4f7b48 100644
--- a/pywikibot/compat/catlib.py
+++ b/pywikibot/compat/catlib.py
@@ -15,6 +15,7 @@
 
 
 from pywikibot import Category
+from pywikibot.tools import ModuleDeprecationWrapper
 
 
 def change_category(article, oldCat, newCat, comment=None, sortKey=None,
@@ -22,3 +23,7 @@
     return article.change_category(oldCat, newCat, comment, sortKey, inPlace)
 
 __all__ = ('Category', 'change_category',)
+
+wrapper = ModuleDeprecationWrapper(__name__)
+wrapper._add_deprecated_attr('Category', replacement_name='pywikibot.Category')
+wrapper._add_deprecated_attr('change_category', 
replacement_name='Page.change_category')
diff --git a/pywikibot/compat/userlib.py b/pywikibot/compat/userlib.py
index 7150992..4c999c7 100644
--- a/pywikibot/compat/userlib.py
+++ b/pywikibot/compat/userlib.py
@@ -15,5 +15,9 @@
 
 
 from pywikibot import User
+from pywikibot.tools import ModuleDeprecationWrapper
 
 __all__ = ('User',)
+
+wrapper = ModuleDeprecationWrapper(__name__)
+wrapper._add_deprecated_attr('User', replacement_name='pywikibot.User')

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa29035d8f645724c4a5d09d90e64e03f2823f9a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa <[email protected]>

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

Reply via email to