jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/725403 )
Change subject: [cleanup] Remove @deprecate_arg decorators ......................................................................
[cleanup] Remove @deprecate_arg decorators
Change-Id: I0ac7877a0d96a44f9cd44d6e4dc5019c708c9cac --- M pywikibot/bot.py M pywikibot/flow.py M pywikibot/page/__init__.py M pywikibot/site/_apisite.py M pywikibot/site/_extensions.py M pywikibot/textlib.py 6 files changed, 3 insertions(+), 29 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 1877226..35ff565 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -172,7 +172,6 @@ ) from pywikibot.tools import ( PYTHON_VERSION, - deprecate_arg, deprecated, deprecated_args, issue_deprecation_warning, @@ -1338,7 +1337,6 @@
return True
- @deprecate_arg('async', 'asynchronous') # T106230 @deprecated_args(comment='summary') def userPut(self, page: 'pywikibot.page.BasePage', oldtext: str, newtext: str, **kwargs: Any) -> bool: diff --git a/pywikibot/flow.py b/pywikibot/flow.py index 39c7b23..c99bb4f 100644 --- a/pywikibot/flow.py +++ b/pywikibot/flow.py @@ -1,6 +1,6 @@ """Objects representing Flow entities, like boards, topics, and posts.""" # -# (C) Pywikibot team, 2015-2020 +# (C) Pywikibot team, 2015-2021 # # Distributed under the terms of the MIT license. # @@ -18,7 +18,6 @@ UnknownExtensionError, ) from pywikibot.page import BasePage, User -from pywikibot.tools import deprecate_arg
logger = logging.getLogger('pywiki.wiki.flow') @@ -114,7 +113,6 @@ new_params[key] = value return new_params
- @deprecate_arg('format', 'content_format') def topics(self, content_format: str = 'wikitext', limit: int = 100, sort_by: str = 'newest', offset: Union[str, datetime.datetime, None] = None, @@ -147,7 +145,6 @@ cont_args = self._parse_url(data['links']['pagination']) data = self.site.load_topiclist(self, **cont_args)
- @deprecate_arg('format', 'content_format') def new_topic(self, title: str, content: str, content_format: str = 'wikitext') -> 'Topic': """Create and return a Topic object for a new topic on this Board. @@ -181,7 +178,6 @@ self.root._load(load_from_topic=True)
@classmethod - @deprecate_arg('format', 'content_format') def create_topic(cls: TOPIC_CLASS_TYPE, board: 'Board', title: str, content: str, content_format: str = 'wikitext' ) -> 'Topic': @@ -238,7 +234,6 @@ """Whether this topic is moderated.""" return self.root._current_revision['isModerated']
- @deprecate_arg('format', 'content_format') def replies(self, content_format: str = 'wikitext', force: bool = False ) -> List['Post']: """A list of replies to this topic's root post. @@ -250,7 +245,6 @@ """ return self.root.replies(content_format=content_format, force=force)
- @deprecate_arg('format', 'content_format') def reply(self, content: str, content_format: str = 'wikitext') -> 'Post': """A convenience method to reply to this topic's root post.
@@ -437,7 +431,6 @@ self._current_revision['creator']['name']) return self._creator
- @deprecate_arg('format', 'content_format') def get(self, content_format: str = 'wikitext', force: bool = False) -> str: """Return the contents of the post in the given format. @@ -450,7 +443,6 @@ self._load(content_format=content_format) return self._content[content_format]
- @deprecate_arg('format', 'content_format') def replies(self, content_format: str = 'wikitext', force: bool = False ) -> List['Post']: """Return this post's replies. @@ -476,7 +468,6 @@
return self._replies
- @deprecate_arg('format', 'content_format') def reply(self, content: str, content_format: str = 'wikitext') -> 'Post': """Reply to this post.
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py index ee06a02..f60bd62 100644 --- a/pywikibot/page/__init__.py +++ b/pywikibot/page/__init__.py @@ -69,7 +69,6 @@ from pywikibot.tools import ( ComparableMixin, compute_file_hash, - deprecate_arg, deprecated, deprecated_args, first_upper, @@ -648,7 +647,6 @@ """ return self.properties(force=force).get('defaultsort')
- @deprecate_arg('refresh', 'force') def expand_text(self, force=False, includecomments=False) -> str: """Return the page text with all templates and parser words expanded.
@@ -1150,7 +1148,6 @@ # no restricting template found return True
- @deprecate_arg('async', 'asynchronous') # T106230 @deprecated_args(comment='summary') def save(self, summary: Optional[str] = None, @@ -1271,7 +1268,6 @@ fallback_prompt='; cosmetic changes') return summary
- @deprecate_arg('async', 'asynchronous') # T106230 @deprecated_args(comment='summary', watchArticle='watch', minorEdit='minor') def put(self, newtext, summary=None, watch=None, minor=True, botflag=None, @@ -1731,7 +1727,6 @@ movetalk=movetalk, noredirect=noredirect)
- @deprecate_arg('quit', 'automatic_quit') def delete(self, reason: Optional[str] = None, prompt: bool = True, @@ -3190,7 +3185,6 @@ for contrib in data['revisions']: yield page, Revision(**contrib)
- @deprecate_arg('number', 'total') def uploadedImages(self, total=10): """ Yield tuples describing files uploaded by this user. diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py index 57503f0..34f4739 100644 --- a/pywikibot/site/_apisite.py +++ b/pywikibot/site/_apisite.py @@ -73,7 +73,6 @@ from pywikibot.tools import ( MediaWikiVersion, compute_file_hash, - deprecate_arg, deprecated, deprecated_args, issue_deprecation_warning, @@ -2205,7 +2204,6 @@ return set(self.siteinfo.get('restrictions')['levels'])
@need_right('protect') - @deprecate_arg('summary', 'reason') def protect(self, page, protections: dict, reason: str, expiry=None, **kwargs): """(Un)protect a wiki page. Requires administrator status. @@ -2456,7 +2454,6 @@ siiprop=props) return req.submit()['query']['stashimageinfo'][0]
- @deprecate_arg('imagepage', 'filepage') @need_right('upload') def upload(self, filepage, *, source_filename: Optional[str] = None, diff --git a/pywikibot/site/_extensions.py b/pywikibot/site/_extensions.py index 6a1d2df..31f0344 100644 --- a/pywikibot/site/_extensions.py +++ b/pywikibot/site/_extensions.py @@ -14,7 +14,7 @@ SiteDefinitionError, ) from pywikibot.site._decorators import need_extension, need_right -from pywikibot.tools import deprecate_arg, deprecated_args, merge_unique_dicts +from pywikibot.tools import deprecated_args, merge_unique_dicts
class EchoMixin: @@ -370,7 +370,6 @@ return data['flow']['view-topiclist']['result']['topiclist']
@need_extension('Flow') - @deprecate_arg('format', 'content_format') def load_topiclist(self, page, content_format: str = 'wikitext', limit=100, sortby='newest', toconly=False, offset=None, offset_id=None, reverse=False, include_offset=False): @@ -413,7 +412,6 @@ return data['flow']['view-topiclist']['result']['topiclist']
@need_extension('Flow') - @deprecate_arg('format', 'content_format') def load_topic(self, page, content_format: str): """ Retrieve the data for a Flow topic. @@ -432,7 +430,6 @@ return data['flow']['view-topic']['result']['topic']
@need_extension('Flow') - @deprecate_arg('format', 'content_format') def load_post_current_revision(self, page, post_id, content_format: str): """ Retrieve the data for a post to a Flow topic. @@ -454,7 +451,6 @@
@need_right('edit') @need_extension('Flow') - @deprecate_arg('format', 'content_format') def create_new_topic(self, page, title, content, content_format): """ Create a new topic on a Flow board. @@ -480,7 +476,6 @@
@need_right('edit') @need_extension('Flow') - @deprecate_arg('format', 'content_format') def reply_to_post(self, page, reply_to_uuid: str, content: str, content_format: str) -> dict: """Reply to a post on a Flow topic. diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py index b5e5bfe..ec06c67 100644 --- a/pywikibot/textlib.py +++ b/pywikibot/textlib.py @@ -24,7 +24,7 @@ from pywikibot.backports import Tuple from pywikibot.exceptions import InvalidTitleError, SiteDefinitionError from pywikibot.family import Family -from pywikibot.tools import deprecate_arg, issue_deprecation_warning +from pywikibot.tools import issue_deprecation_warning
try: @@ -969,7 +969,6 @@ # do not find or change links of other kinds, nor any that are formatted # as in-line interwiki links (e.g., "[[:es:Artículo]]".
-@deprecate_arg('pageLink', True) def getLanguageLinks(text: str, insite=None, template_subpage=False) -> dict: """ Return a dict of inter-language links found in text.