jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/725404 )
Change subject: [cleanup] Remove @deprecated_args decorator ......................................................................
[cleanup] Remove @deprecated_args decorator
- Use issue_deprecation_warning instead of warn for outdated filterredir parameter value of APISite.allpages method - remove tests for outdated parameters
Change-Id: Id217ec0813d1543ccdc5a461b25bb4b5b21d8b9b --- M ROADMAP.rst M pywikibot/bot.py M pywikibot/bot_choice.py M pywikibot/comms/eventstreams.py M pywikibot/comms/http.py M pywikibot/cosmetic_changes.py M pywikibot/daemonize.py M pywikibot/data/mysql.py M pywikibot/diff.py M pywikibot/family.py M pywikibot/i18n.py M pywikibot/login.py M pywikibot/page/__init__.py M pywikibot/pagegenerators.py M pywikibot/site/_apisite.py M pywikibot/site/_datasite.py M pywikibot/site/_extensions.py M pywikibot/site/_generators.py M pywikibot/specialbots/_upload.py M pywikibot/throttle.py M pywikibot/titletranslate.py M pywikibot/tools/djvu.py M pywikibot/userinterfaces/terminal_interface_base.py M tests/site_tests.py 24 files changed, 17 insertions(+), 229 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst index 715e7f7..37e0783 100644 --- a/ROADMAP.rst +++ b/ROADMAP.rst @@ -24,6 +24,7 @@ Deprecations ^^^^^^^^^^^^
+* 7.0.0: Values of APISite.allpages() parameter filterredir other than True, False and None are deprecated * 6.5.0: OutputOption.output() method will be removed in favour of OutputOption.out property * 6.4.0: Pywikibot `began using semantic versioning https://www.mediawiki.org/wiki/Manual:Pywikibot/Development/Guidelines#Deprecation_Policy`_, diff --git a/pywikibot/bot.py b/pywikibot/bot.py index c1b3feb..d477031 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -173,7 +173,6 @@ from pywikibot.tools import ( PYTHON_VERSION, deprecated, - deprecated_args, issue_deprecation_warning, ) from pywikibot.tools._logging import LoggingFormatter @@ -1335,7 +1334,6 @@
return True
- @deprecated_args(comment='summary') def userPut(self, page: 'pywikibot.page.BasePage', oldtext: str, newtext: str, **kwargs: Any) -> bool: """ @@ -1837,7 +1835,6 @@ self.current_page = page self.treat_page()
- @deprecated_args(comment='summary') def put_current(self, new_text: str, ignore_save_related_errors: Optional[bool] = None, ignore_server_errors: Optional[bool] = None, @@ -2009,7 +2006,6 @@ use_from_page = True treat_missing_item = False
- @deprecated_args(use_from_page=True) def __init__(self, **kwargs: Any) -> None: """Initializer of the WikidataBot.""" self.create_missing_item = False diff --git a/pywikibot/bot_choice.py b/pywikibot/bot_choice.py index 90810e4..90fc602 100755 --- a/pywikibot/bot_choice.py +++ b/pywikibot/bot_choice.py @@ -14,11 +14,7 @@
from pywikibot.backports import Iterable, Sequence
-from pywikibot.tools import ( - deprecated, - deprecated_args, - issue_deprecation_warning, -) +from pywikibot.tools import deprecated, issue_deprecation_warning
# TODO: replace these after T286867
@@ -274,7 +270,6 @@ end = min(len(self.text), self.end + self.context) return self.text[start:end]
- @deprecated_args(start_context='start', end_context='end') @deprecated('pywikibot.output(ContextOption.out)', since='6.2.0') def output_range(self, start: int, end: int) -> None: """DEPRECATED. Output a section from the text.""" diff --git a/pywikibot/comms/eventstreams.py b/pywikibot/comms/eventstreams.py index a2059ab..c92bc7b 100644 --- a/pywikibot/comms/eventstreams.py +++ b/pywikibot/comms/eventstreams.py @@ -25,7 +25,6 @@ from requests.packages.urllib3.util.response import httplib
from pywikibot import Site, Timestamp, config, debug, warning -from pywikibot.tools import deprecated_args
try: @@ -76,7 +75,6 @@ >>> del stream """
- @deprecated_args(stream='streams') def __init__(self, **kwargs): """Initializer.
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index 695923b..23c1bce 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -50,7 +50,6 @@ from pywikibot.logging import critical, debug, error, log, warning from pywikibot.tools import ( deprecated, - deprecated_args, file_mode_checker, issue_deprecation_warning, ) @@ -222,7 +221,6 @@ return UserAgent().random
-@deprecated_args(body='data') def request(site, uri: Optional[str] = None, headers: Optional[dict] = None, @@ -323,7 +321,6 @@ warning('Http response status {}'.format(response.status_code))
-@deprecated_args(body='data') def fetch(uri: str, method: str = 'GET', headers: Optional[dict] = None, default_error_handling: bool = True, use_fake_user_agent: Union[bool, str] = False, **kwargs): diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py index 96ac707..7585269 100755 --- a/pywikibot/cosmetic_changes.py +++ b/pywikibot/cosmetic_changes.py @@ -71,7 +71,6 @@ ) from pywikibot.tools import ( deprecated, - deprecated_args, first_lower, first_upper, issue_deprecation_warning, @@ -225,7 +224,6 @@
"""Cosmetic changes toolkit."""
- @deprecated_args(redirect=True, diff='show_diff', site='page') def __init__(self, page: 'pywikibot.page.BasePage', *, show_diff: bool = False, namespace: Optional[int] = None, @@ -312,7 +310,6 @@ @classmethod @deprecated('CosmeticChangesToolkit with pywikibot.Page object', since='20200415') - @deprecated_args(diff='show_diff') def from_page(cls, page: 'pywikibot.page.BasePage', show_diff: bool = False, ignore: IntEnum = CANCEL.ALL) -> 'CosmeticChangesToolkit': diff --git a/pywikibot/daemonize.py b/pywikibot/daemonize.py index 16f3716..0cba456 100644 --- a/pywikibot/daemonize.py +++ b/pywikibot/daemonize.py @@ -10,13 +10,10 @@ import sys from typing import Optional
-from pywikibot.tools import deprecated_args -
is_daemon = False
-@deprecated_args(write_pid=True) def daemonize(close_fd: bool = True, chdir: bool = True, redirect_std: Optional[str] = None) -> None: """ diff --git a/pywikibot/data/mysql.py b/pywikibot/data/mysql.py index 6bfad0c..af8ae6e 100644 --- a/pywikibot/data/mysql.py +++ b/pywikibot/data/mysql.py @@ -10,7 +10,6 @@
import pywikibot from pywikibot import config -from pywikibot.tools import deprecated_args
try: @@ -19,7 +18,6 @@ raise ImportError('MySQL python module not found. Please install PyMySQL.')
-@deprecated_args(encoding=True) def mysql_query(query: str, params=None, dbname: Optional[str] = None, verbose: Optional[bool] = None): diff --git a/pywikibot/diff.py b/pywikibot/diff.py index 9c91a9b..d4eec47 100644 --- a/pywikibot/diff.py +++ b/pywikibot/diff.py @@ -15,7 +15,7 @@
import pywikibot from pywikibot.backports import Dict, Iterable, List, Sequence, Tuple -from pywikibot.tools import chars, deprecated_args +from pywikibot.tools import chars from pywikibot.tools.formatter import color_format
@@ -249,7 +249,6 @@ If all hunks are approved, text_b will be obtained. """
- @deprecated_args(n='context') def __init__(self, text_a: str, text_b: str, context: int = 0, by_letter: bool = False, replace_invisible: bool = False) -> None: diff --git a/pywikibot/family.py b/pywikibot/family.py index f3222b8..adc19a4 100644 --- a/pywikibot/family.py +++ b/pywikibot/family.py @@ -21,12 +21,7 @@ from pywikibot import config from pywikibot.backports import Dict, List, Tuple from pywikibot.exceptions import FamilyMaintenanceWarning, UnknownFamilyError -from pywikibot.tools import ( - ModuleDeprecationWrapper, - classproperty, - deprecated, - deprecated_args, -) +from pywikibot.tools import classproperty, deprecated, ModuleDeprecationWrapper
logger = logging.getLogger('pywiki.wiki.family') @@ -546,7 +541,6 @@ _families = {}
@staticmethod - @deprecated_args(fatal=True) def load(fam: Optional[str] = None): """Import the named family.
@@ -788,7 +782,6 @@ """ raise NotImplementedError('This family does not support EventStreams')
- @deprecated_args(name='title') def get_address(self, code, title): """Return the path to title using index.php with redirects disabled.""" return '{}?title={}&redirect=no'.format(self.path(code), title) @@ -1227,7 +1220,6 @@ return '{}.wikimedia.org'.format(cls.name)
-@deprecated_args(site=True) def AutoFamily(name: str, url: str): """ Family that automatically loads the site configuration. diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 25d751d..2ae3f32 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -43,10 +43,7 @@ Sequence, ) from pywikibot.plural import plural_rule -from pywikibot.tools import ( - ModuleDeprecationWrapper, - deprecated_args, -) +from pywikibot.tools import ModuleDeprecationWrapper
STR_OR_SITE_TYPE = Union[str, 'pywikibot.site.BaseSite']
@@ -637,7 +634,6 @@ return trans
-@deprecated_args(code='source') def twtranslate(source: STR_OR_SITE_TYPE, twtitle: str, parameters: Union[Sequence[str], Mapping[str, int], @@ -763,7 +759,6 @@ return trans
-@deprecated_args(code='source') def twhas_key(source: STR_OR_SITE_TYPE, twtitle: str) -> bool: """ Check if a message has a translation in the specified language code. diff --git a/pywikibot/login.py b/pywikibot/login.py index 144467d..6037795 100644 --- a/pywikibot/login.py +++ b/pywikibot/login.py @@ -19,9 +19,8 @@ from pywikibot.comms import http from pywikibot.exceptions import APIError, NoUsernameError from pywikibot.tools import ( - ModuleDeprecationWrapper, - deprecated_args, file_mode_checker, + ModuleDeprecationWrapper, normalize_username, )
@@ -88,7 +87,6 @@
"""Site login manager."""
- @deprecated_args(username='user', verbose=True, sysop=True) def __init__(self, password: Optional[str] = None, site: OPT_SITE_TYPE = None, user: Optional[str] = None) -> None: @@ -367,7 +365,6 @@ # NOTE: Currently OauthLoginManager use mwoauth directly to complete OAuth # authentication process
- @deprecated_args(sysop=True) def __init__(self, password: Optional[str] = None, site: OPT_SITE_TYPE = None, user: Optional[str] = None) -> None: diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py index b2f0c5b..c7fafcf 100644 --- a/pywikibot/page/__init__.py +++ b/pywikibot/page/__init__.py @@ -70,7 +70,6 @@ ComparableMixin, compute_file_hash, deprecated, - deprecated_args, first_upper, is_ip_address, issue_deprecation_warning, @@ -259,10 +258,6 @@ self.site.loadpageinfo(self) return self._pageid
- @deprecated_args( - savetitle='as_url', withNamespace='with_ns', - withSection='with_section', forceInterwiki='force_interwiki', - asUrl='as_url', asLink='as_link', allowInterwiki='allow_interwiki') def title(self, *, underscore=False, with_ns=True, with_section=True, as_url=False, as_link=False, allow_interwiki=True, force_interwiki=False, textlink=False, @@ -878,9 +873,6 @@ disambig_in_page = disambigs.intersection(templates) return self.namespace() != 10 and bool(disambig_in_page)
- @deprecated_args(withTemplateInclusion='with_template_inclusion', - onlyTemplateInclusion='only_template_inclusion', - redirectsOnly='filter_redirects') def getReferences(self, follow_redirects: bool = True, with_template_inclusion: bool = True, @@ -924,8 +916,6 @@ content=content )
- @deprecated_args(followRedirects='follow_redirects', - filterRedirects='filter_redirects') def backlinks(self, follow_redirects: bool = True, filter_redirects: Optional[bool] = None, @@ -1142,7 +1132,6 @@ # no restricting template found return True
- @deprecated_args(comment='summary') def save(self, summary: Optional[str] = None, watch: Union[str, bool, None] = None, @@ -1262,8 +1251,6 @@ fallback_prompt='; cosmetic changes') return summary
- @deprecated_args(comment='summary', watchArticle='watch', - minorEdit='minor') def put(self, newtext, summary=None, watch=None, minor=True, botflag=None, force=False, asynchronous=False, callback=None, **kwargs): """ @@ -1283,8 +1270,6 @@
@deprecated('put(asynchronous=True) or save(asynchronous=True)', since='20180501') - @deprecated_args(comment='summary', watchArticle='watch', - minorEdit='minor') def put_async(self, newtext, summary=None, watch=None, minor=True, botflag=None, force=False, callback=None, **kwargs): # pragma: no cover @@ -1517,7 +1502,6 @@ """ return self.site.pageimages(self, total=total, content=content)
- @deprecated_args(withSortKey='with_sort_key') def categories(self, with_sort_key: bool = False, total: Optional[int] = None, @@ -1613,7 +1597,6 @@ else: return lastmove.target_page
- @deprecated_args(getText='content', reverseOrder='reverse') def revisions(self, reverse: bool = False, total: Optional[int] = None, @@ -1627,7 +1610,6 @@ return (self._revisions[rev] for rev in sorted(self._revisions, reverse=not reverse)[:total])
- @deprecated_args(reverseOrder='reverse') def getVersionHistoryTable(self, reverse: bool = False, total: Optional[int] = None): @@ -1697,7 +1679,6 @@ """ self.site.merge_history(self, dest, timestamp, reason)
- @deprecated_args(deleteAndMove='noredirect', movetalkpage='movetalk') def move(self, newtitle: str, reason: Optional[str] = None, @@ -1808,7 +1789,6 @@ self._deletedRevs[rev['timestamp']] = rev yield rev['timestamp']
- @deprecated_args(retrieveText='content') def getDeletedRevision(self, timestamp, content=False, **kwargs) -> List: """ Return a particular deleted revision by timestamp. @@ -1847,7 +1827,6 @@ .format(timestamp)) self._deletedRevs[timestamp]['marked'] = undelete
- @deprecated_args(comment='reason') def undelete(self, reason: Optional[str] = None): """ Undelete revisions based on the markers set by previous calls. @@ -1915,9 +1894,6 @@
self.site.protect(self, protections, reason, **kwargs)
- @deprecated_args( - comment='summary', oldCat='old_cat', newCat='new_cat', - sortKey='sort_key', inPlace='in_place') def change_category( self, old_cat, new_cat, summary=None, sort_key=None, in_place=True, include=None @@ -2048,7 +2024,6 @@
"""Page: A MediaWiki page."""
- @deprecated_args(defaultNamespace='ns') def __init__(self, source, title: str = '', ns=0): """Instantiate a Page object.""" if isinstance(source, pywikibot.site.BaseSite): @@ -2533,7 +2508,6 @@
"""A page in the Category: namespace."""
- @deprecated_args(sortKey='sort_key') def __init__(self, source, title: str = '', sort_key=None): """ Initializer. @@ -2546,7 +2520,6 @@ raise ValueError("'{}' is not in the category namespace!" .format(self.title()))
- @deprecated_args(sortKey='sort_key') def aslink(self, sort_key: Optional[str] = None) -> str: """ Return a link to place a page in this Category. @@ -2617,7 +2590,6 @@ if total == 0: return
- @deprecated_args(startFrom='startprefix', startsort=True, endsort=True) def articles(self, recurse: Union[int, bool] = False, total: Optional[int] = None, @@ -2832,7 +2804,6 @@ This class also represents the Wiki page User:<username> """
- @deprecated_args(site='source', name='title') def __init__(self, source, title=''): """ Initializer for a User object. @@ -3107,7 +3078,6 @@ """ return next(iter(self.logevents(total=1)), None)
- @deprecated_args(limit='total', namespace='namespaces') def contributions(self, total: int = 500, **kwargs) -> tuple: """ Yield tuples describing this user edits. @@ -4446,7 +4416,6 @@
SNAK_TYPES = ('value', 'somevalue', 'novalue')
- @deprecated_args(isReference='is_reference', isQualifier='is_qualifier') def __init__(self, site, pid, snak=None, hash=None, is_reference=False, is_qualifier=False, rank='normal', **kwargs): """ @@ -5248,7 +5217,6 @@ '|&#x[0-9A-Fa-f]+;' )
- @deprecated_args(defaultNamespace='default_namespace') def __init__(self, text, source=None, default_namespace=0): """ Initializer. @@ -5833,7 +5801,6 @@ return _ENTITY_SUB(handle_entity, text)
-@deprecated_args(site='encodings') @deprecated('pywikibot.tools.chars.url2string', since='6.2.0') def url2unicode(title: str, encodings='utf-8') -> str: """ diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index fb2494b..3db0b91 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -62,7 +62,6 @@ from pywikibot.tools import ( DequeGenerator, deprecated, - deprecated_args, filter_unique, intersect_generators, itergroup, @@ -679,7 +678,6 @@
return dupfiltergen
- @deprecated_args(arg='category') def getCategory(self, category: str ) -> Tuple['pywikibot.Category', Optional[str]]: """ @@ -711,7 +709,6 @@ default_namespace=14)) return cat, startfrom
- @deprecated_args(arg='category') def getCategoryGen(self, category: str, recurse: bool = False, content: bool = False, @@ -1339,7 +1336,6 @@
@deprecated('Site.allpages()', since='20180512') -@deprecated_args(step=True) def AllpagesPageGenerator( start: str = '!', namespace: int = 0, @@ -1370,7 +1366,6 @@ filterredir=filterredir, total=total, content=content)
-@deprecated_args(step=True) def PrefixingPageGenerator(prefix: str, namespace: NAMESPACE_OR_INT_TYPE = None, includeredirects: Union[None, bool, str] = True, @@ -1410,7 +1405,6 @@ filterredir=filterredir, total=total, content=content)
-@deprecated_args(number='total', mode='logtype', repeat=True) def LogeventsPageGenerator(logtype: Optional[str] = None, user: Optional[str] = None, site: OPT_SITE_TYPE = None, @@ -1446,8 +1440,6 @@ pywikibot.exception(e)
-@deprecated_args(number='total', step=True, namespace='namespaces', - repeat=True, get_redirect=True) def NewpagesPageGenerator(site: OPT_SITE_TYPE = None, namespaces: Tuple[int] = (0, ), total: Optional[int] = None @@ -1495,7 +1487,6 @@
@deprecated('site.unconnected_pages()', since='20180512') -@deprecated_args(step=True) def UnconnectedPageGenerator(site: OPT_SITE_TYPE = None, total: Optional[int] = None ) -> Iterable['pywikibot.page.Page']: @@ -1513,7 +1504,6 @@
@deprecated('File.usingPages()', since='20200515') -@deprecated_args(referredImagePage='referredFilePage', step=True) def FileLinksGenerator(referredFilePage: 'pywikibot.page.FilePage', total: Optional[int] = None, content: bool = False @@ -1524,7 +1514,6 @@
@deprecated('Page.imagelinks()', since='20200515') -@deprecated_args(step=True) def ImagesPageGenerator(pageWithImages: 'pywikibot.page.Page', total: Optional[int] = None, content: bool = False @@ -1540,7 +1529,6 @@ return (pywikibot.Page(link) for link in page.interwiki())
-@deprecated_args(step=True) def LanguageLinksPageGenerator(page: 'pywikibot.page.Page', total: Optional[int] = None ) -> Iterable['pywikibot.page.Page']: @@ -1548,7 +1536,6 @@ return (pywikibot.Page(link) for link in page.iterlanglinks(total=total))
-@deprecated_args(step=True) def CategorizedPageGenerator(category: pywikibot.page.Category, recurse: bool = False, start: Optional[int] = None, @@ -1580,7 +1567,6 @@ yield from category.articles(**kwargs)
-@deprecated_args(step=True) def SubCategoriesPageGenerator(category: 'pywikibot.page.Category', recurse: bool = False, start: Optional[int] = None, @@ -1608,7 +1594,6 @@
@deprecated('Page.linkedPages()', since='20200515') -@deprecated_args(step=True) def LinkedPageGenerator(linkingPage: 'pywikibot.page.Page', total: Optional[int] = None, content: bool = False @@ -1724,7 +1709,6 @@ return site.load_pages_from_pageids(pageids)
-@deprecated_args(number='total', step=True) def UserContributionsGenerator(username: str, namespaces: Optional[List[int]] = None, site: OPT_SITE_TYPE = None, @@ -1795,7 +1779,6 @@ return (page for page in generator if page.namespace() in namespaces)
-@deprecated_args(ignoreList='ignore_list') def PageTitleFilterPageGenerator(generator: Iterable['pywikibot.page.Page'], ignore_list: Dict[str, Dict[str, str]] ) -> Iterable['pywikibot.page.Page']: @@ -1979,7 +1962,6 @@ return regex_list
@classmethod - @deprecated_args(inverse='quantifier') def titlefilter(cls: REGEX_FILTER_CLASS, generator: Iterable['pywikibot.page.Page'], regex: PATTERN_STR_OR_SEQ_TYPE, @@ -2052,7 +2034,6 @@ yield page
-@deprecated_args(site=True) def CategoryFilterPageGenerator(generator: Iterable['pywikibot.page.Page'], category_list: Sequence['pywikibot.page.Category'] @@ -2073,7 +2054,6 @@ RegexBodyFilterPageGenerator = RegexFilter.contentfilter
-@deprecated_args(begintime='last_edit_start', endtime='last_edit_end') def EdittimeFilterPageGenerator( generator: Iterable['pywikibot.page.Page'], last_edit_start: Optional[datetime.datetime] = None, @@ -2270,7 +2250,6 @@ yield from reversed(list(filtered_generator()))
-@deprecated_args(pageNumber='groupsize', step='groupsize', lookahead=True) def PreloadingGenerator(generator: Iterable['pywikibot.page.Page'], groupsize: int = 50 ) -> Iterable['pywikibot.page.Page']: @@ -2299,7 +2278,6 @@ yield from site.preloadpages(pages, groupsize=groupsize)
-@deprecated_args(step='groupsize') def DequePreloadingGenerator(generator: Iterable['pywikibot.page.Page'], groupsize: int = 50 ) -> Iterable['pywikibot.page.Page']: @@ -2315,7 +2293,6 @@ yield from PreloadingGenerator(generator, page_count)
-@deprecated_args(step='groupsize') def PreloadingEntityGenerator(generator: Iterable['pywikibot.page.Page'], groupsize: int = 50 ) -> Iterable['pywikibot.page.Page']: @@ -2343,7 +2320,6 @@ yield from repo.preload_entities(pages, groupsize)
-@deprecated_args(number='total', step=True, repeat=True) def NewimagesPageGenerator(total: Optional[int] = None, site: OPT_SITE_TYPE = None ) -> Iterable['pywikibot.page.Page']: @@ -2410,7 +2386,6 @@
@deprecated('Site.unusedfiles()', since='20200515') -@deprecated_args(extension=True, number='total', repeat=True) def UnusedFilesGenerator(total: Optional[int] = None, # pragma: no cover site: OPT_SITE_TYPE = None ) -> Iterable['pywikibot.page.FilePage']: @@ -2426,7 +2401,6 @@
@deprecated('Site.withoutinterwiki()', since='20200515') -@deprecated_args(number='total', repeat=True) def WithoutInterwikiPageGenerator(total: Optional[int] = None, site: OPT_SITE_TYPE = None ) -> Iterable['pywikibot.page.Page']: @@ -2442,7 +2416,6 @@
@deprecated('Site.uncategorizedcategories()', since='20200515') -@deprecated_args(number='total', repeat=True) def UnCategorizedCategoryGenerator(total: Optional[int] = 100, site: OPT_SITE_TYPE = None ) -> Iterable['pywikibot.Category']: @@ -2458,7 +2431,6 @@
@deprecated('Site.uncategorizedimages()', since='20200515') -@deprecated_args(number='total', repeat=True) def UnCategorizedImageGenerator(total: int = 100, # pragma: no cover site: OPT_SITE_TYPE = None ) -> Iterable['pywikibot.page.FilePage']: @@ -2474,7 +2446,6 @@
@deprecated('Site.uncategorizedpages()', since='20200515') -@deprecated_args(number='total', repeat=True) def UnCategorizedPageGenerator(total: int = 100, # pragma: no cover site: OPT_SITE_TYPE = None ) -> Iterable['pywikibot.page.Page']: @@ -2490,7 +2461,6 @@
@deprecated('Site.uncategorizedtemplates()', since='20200515') -@deprecated_args(number='total', repeat=True) def UnCategorizedTemplateGenerator(total: int = 100, # pragma: no cover site: OPT_SITE_TYPE = None ) -> Iterable['pywikibot.page.Page']: @@ -2506,7 +2476,6 @@
@deprecated('Site.lonelypages()', since='20200515') -@deprecated_args(number='total', repeat=True) def LonelyPagesPageGenerator(total: Optional[int] = None, # pragma: no cover site: OPT_SITE_TYPE = None ) -> Iterable['pywikibot.page.Page']: @@ -2522,7 +2491,6 @@
@deprecated('Site.unwatchedpages()', since='20200515') -@deprecated_args(number='total', repeat=True) def UnwatchedPagesPageGenerator(total: Optional[int] = None, site: OPT_SITE_TYPE = None ) -> Iterable['pywikibot.page.Page']: @@ -2569,7 +2537,6 @@ return site.wantedpages(total=total)
-@deprecated_args(number='total', repeat=True) def AncientPagesPageGenerator(total: int = 100, # pragma: no cover site: OPT_SITE_TYPE = None ) -> Iterable['pywikibot.page.Page']: @@ -2585,7 +2552,6 @@
@deprecated('Site.deadendpages()', since='20200515') -@deprecated_args(number='total', repeat=True) def DeadendPagesPageGenerator(total: int = 100, # pragma: no cover site: OPT_SITE_TYPE = None ) -> Iterable['pywikibot.page.Page']: @@ -2600,7 +2566,6 @@ return site.deadendpages(total=total)
-@deprecated_args(number='total', repeat=True) def LongPagesPageGenerator(total: int = 100, site: OPT_SITE_TYPE = None ) -> Iterable['pywikibot.page.Page']: @@ -2615,7 +2580,6 @@ return (page for page, _ in site.longpages(total=total))
-@deprecated_args(number='total', repeat=True) def ShortPagesPageGenerator(total: int = 100, site: OPT_SITE_TYPE = None ) -> Iterable['pywikibot.page.Page']: @@ -2631,7 +2595,6 @@
@deprecated('Site.randompages()', since='20200515') -@deprecated_args(number='total') def RandomPageGenerator(total: Optional[int] = None, # pragma: no cover site: OPT_SITE_TYPE = None, namespaces: Optional[ @@ -2649,7 +2612,6 @@
@deprecated('Site.randompages()', since='20200515') -@deprecated_args(number='total') def RandomRedirectPageGenerator(total: Optional[int] = None, site: OPT_SITE_TYPE = None, namespaces: Optional[ @@ -2668,7 +2630,6 @@
@deprecated('Site.exturlusage()', since='20200515') -@deprecated_args(link='url', euprotocol='protocol', step=True) def LinksearchPageGenerator(url: str, namespaces: Optional[List[int]] = None, total: Optional[int] = None, @@ -2693,7 +2654,6 @@
@deprecated('Site.search()', since='20200515') -@deprecated_args(number='total', step=True) def SearchPageGenerator(query: str, # pragma: no cover total: Optional[int] = None, namespaces: Optional[ @@ -2872,7 +2832,6 @@ :ivar parser: holds the xmlreader.XmlDump parse method """
- @deprecated_args(xmlFilename='filename') def __init__(self, filename: str, start: Optional[str] = None, namespaces: Union[ None, NAMESPACE_OR_STR_TYPE, @@ -2945,7 +2904,6 @@ yield pywikibot.Page(pywikibot.Link(current_year, site))
-@deprecated_args(startMonth='start_month', endMonth='end_month') def DayPageGenerator(start_month: int = 1, end_month: int = 12, site: OPT_SITE_TYPE = None, year: int = 2000 ) -> Iterable['pywikibot.page.Page']: diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py index a32fe63..eb2623e 100644 --- a/pywikibot/site/_apisite.py +++ b/pywikibot/site/_apisite.py @@ -74,7 +74,6 @@ MediaWikiVersion, compute_file_hash, deprecated, - deprecated_args, issue_deprecation_warning, merge_unique_dicts, normalize_username, @@ -212,7 +211,6 @@ return pywikibot.Site(url=site['url'] + '/w/index.php') raise ValueError('Cannot parse a site out of {}.'.format(dbname))
- @deprecated_args(step=True) def _generator(self, gen_class, type_arg: Optional[str] = None, namespaces=None, total: Optional[int] = None, **args): """Convenience method that returns an API generator. @@ -662,7 +660,6 @@
return OrderedDict((key, _mw_msg_cache[amlang][key]) for key in keys)
- @deprecated_args(forceReload=True) def mediawiki_message(self, key, lang=None) -> str: """Fetch the text for a MediaWiki message.
@@ -754,7 +751,6 @@ return msgs['comma-separator'].join( args[:-2] + [concat.join(args[-2:])])
- @deprecated_args(string='text') def expand_text(self, text: str, title=None, includecomments=None) -> str: """Parse the given text for preprocessing and rendering.
diff --git a/pywikibot/site/_datasite.py b/pywikibot/site/_datasite.py index ffe0e50..0dbb3e5 100644 --- a/pywikibot/site/_datasite.py +++ b/pywikibot/site/_datasite.py @@ -25,7 +25,6 @@ from pywikibot.site._decorators import need_right, need_version from pywikibot.tools import ( deprecated, - deprecated_args, issue_deprecation_warning, itergroup, merge_unique_dicts, @@ -278,7 +277,6 @@
return dtype
- @deprecated_args(identification='entity') @need_right('edit') def editEntity(self, entity, data, bot=True, **kwargs): """ @@ -637,8 +635,6 @@ return req.submit()
@need_right('item-merge') - @deprecated_args(ignoreconflicts='ignore_conflicts', fromItem='from_item', - toItem='to_item') def mergeItems(self, from_item, to_item, ignore_conflicts=None, summary=None, bot=True): """ @@ -694,7 +690,6 @@ req = self._simple_request(**params) return req.submit()
- @deprecated_args(limit='total') def search_entities(self, search: str, language: str, total: Optional[int] = None, **kwargs): """ diff --git a/pywikibot/site/_extensions.py b/pywikibot/site/_extensions.py index 31f0344..98e4b75 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 deprecated_args, merge_unique_dicts +from pywikibot.tools import merge_unique_dicts
class EchoMixin: @@ -232,7 +232,6 @@
"""APISite mixin for WikibaseClient extension."""
- @deprecated_args(step=True) @need_extension('WikibaseClient') def unconnected_pages(self, total=None): """Yield Page objects from Special:UnconnectedPages. diff --git a/pywikibot/site/_generators.py b/pywikibot/site/_generators.py index efe03bf..2314a13 100644 --- a/pywikibot/site/_generators.py +++ b/pywikibot/site/_generators.py @@ -27,7 +27,6 @@ from pywikibot.site._decorators import need_right, need_version from pywikibot.tools import ( deprecated, - deprecated_args, filter_unique, is_ip_address, issue_deprecation_warning, @@ -195,8 +194,6 @@ priority, page = heapq.heappop(prio_queue) yield page
- @deprecated_args( - followRedirects='follow_redirects', filterRedirects='filter_redirects') def pagebacklinks(self, page, *, follow_redirects=False, filter_redirects=None, namespaces=None, total=None, content=False): @@ -260,7 +257,6 @@ return itertools.chain(*genlist.values()) return blgen
- @deprecated_args(step=True, filterRedirects='filter_redirects') def page_embeddedin(self, page, *, filter_redirects=None, namespaces=None, total=None, content=False): """Iterate all pages that embedded the given page as a template. @@ -292,11 +288,6 @@ namespaces=namespaces, total=total, g_content=content, **eiargs)
- @deprecated_args( - step=None, followRedirects='follow_redirects', - filterRedirects='filter_redirects', - onlyTemplateInclusion='only_template_inclusion', - withTemplateInclusion='with_template_inclusion') def pagereferences(self, page, *, follow_redirects=False, filter_redirects=None, with_template_inclusion=True, only_template_inclusion=False, namespaces=None, @@ -335,7 +326,6 @@ namespaces=namespaces, content=content) ), total)
- @deprecated_args(step=True) def pagelinks(self, page, *, namespaces=None, follow_redirects=False, total=None, content=False): """Iterate internal wikilinks contained (or transcluded) on page. @@ -367,7 +357,6 @@ **plargs)
# Sortkey doesn't work with generator - @deprecated_args(withSortKey=True, step=True) def pagecategories(self, page, *, total=None, content=False): """Iterate categories to which page belongs.
@@ -387,7 +376,6 @@ type_arg='categories', total=total, g_content=content, **clargs)
- @deprecated_args(step=True) def pageimages(self, page, *, total=None, content=False): """Iterate images used (not just linked) on the page.
@@ -403,7 +391,6 @@ titles=imtitle, total=total, g_content=content)
- @deprecated_args(step=True) def pagetemplates(self, page, *, namespaces=None, total=None, content=False): """Iterate templates transcluded (not just linked) on the page. @@ -426,7 +413,6 @@ titles=tltitle, namespaces=namespaces, total=total, g_content=content)
- @deprecated_args(step=True, startsort=True, endsort=True) def categorymembers(self, category, *, namespaces=None, sortby: Optional[str] = None, @@ -587,7 +573,6 @@ props.append('roles') return props
- @deprecated_args(getText='content', sysop=True) def loadrevisions(self, page, *, content=False, section=None, **kwargs): """Retrieve revision information and store it in page object.
@@ -715,7 +700,6 @@ raise NoPageError(page) api.update_page(page, pagedata, rvgen.props)
- @deprecated_args(step=True) def pagelanglinks(self, page, *, total: Optional[int] = None, include_obsolete: bool = False, @@ -751,7 +735,6 @@ if link.title or include_empty_titles: yield link
- @deprecated_args(step=True) def page_extlinks(self, page, *, total=None): """Iterate all external links on page, yielding URL strings.
@@ -769,8 +752,6 @@ for linkdata in pageitem['extlinks']: yield linkdata['*']
- @deprecated_args(throttle=True, limit='total', step=True, - includeredirects='filterredir') def allpages(self, start='!', prefix='', namespace=0, filterredir=None, filterlanglinks=None, minsize=None, maxsize=None, protect_type=None, protect_level=None, reverse=False, @@ -808,16 +789,15 @@ # backward compatibility test if filterredir not in (True, False, None): old = filterredir - if filterredir: - if filterredir == 'only': - filterredir = True - else: - filterredir = None - else: + if not filterredir: filterredir = False - warn('The value "{0!r}" for "filterredir" is deprecated; use ' - '{1} instead.'.format(old, filterredir), - DeprecationWarning, 3) + elif filterredir == 'only': + filterredir = True + else: + filterredir = None + issue_deprecation_warning( + 'The value "{}" for "filterredir"'.format(old), + '"{}"'.format(filterredir), since='7.0.0')
apgen = self._generator(api.PageGenerator, type_arg='allpages', namespaces=namespace, @@ -844,7 +824,6 @@ apgen.request['gapdir'] = 'descending' return apgen
- @deprecated_args(step=True) def alllinks(self, start='!', prefix='', namespace=0, unique=False, fromids=False, total=None): """Iterate all links to pages (which need not exist) in one namespace. @@ -883,7 +862,6 @@ p._fromid = link['fromid'] yield p
- @deprecated_args(step=True) def allcategories(self, start='!', prefix='', total=None, reverse=False, content=False): """Iterate categories used (which need not have a Category page). @@ -911,7 +889,6 @@ acgen.request['gacdir'] = 'descending' return acgen
- @deprecated_args(step=True) def botusers(self, total=None): """Iterate bot users.
@@ -929,7 +906,6 @@
yield from self._bots.values()
- @deprecated_args(step=True) def allusers(self, start='!', prefix='', group=None, total=None): """Iterate registered users, ordered by username.
@@ -955,7 +931,6 @@ augen.request['augroup'] = group return augen
- @deprecated_args(step=True) def allimages(self, start='!', prefix='', minsize=None, maxsize=None, reverse=False, sha1=None, sha1base36=None, total=None, content=False): @@ -994,7 +969,6 @@ aigen.request['gaisha1base36'] = sha1base36 return aigen
- @deprecated_args(limit='total') # ignore falimit setting def filearchive(self, start=None, end=None, reverse=False, total=None, **kwargs): """Iterate archived files. @@ -1026,7 +1000,6 @@ fagen.request['fadir'] = 'descending' return fagen
- @deprecated_args(step=True) def blocks(self, starttime=None, endtime=None, reverse=False, blockids=None, users=None, iprange: Optional[str] = None, total: Optional[int] = None): @@ -1084,7 +1057,6 @@ bkgen.request['bkip'] = iprange return bkgen
- @deprecated_args(step=True) def exturlusage(self, url: Optional[str] = None, protocol: Optional[str] = None, namespaces=None, total: Optional[int] = None, content=False): @@ -1123,7 +1095,6 @@ namespaces=namespaces, total=total, g_content=content)
- @deprecated_args(step=True) def imageusage(self, image, namespaces=None, filterredir=None, total=None, content=False): """Iterate Pages that contain links to the given FilePage. @@ -1153,7 +1124,6 @@ namespaces=namespaces, total=total, g_content=content, **iuargs)
- @deprecated_args(step=True) def logevents(self, logtype: Optional[str] = None, user: Optional[str] = None, page=None, namespace=None, start=None, end=None, @@ -1213,12 +1183,6 @@
return legen
- @deprecated_args(includeredirects='redirect', namespace='namespaces', - number='total', rcend='end', rclimit='total', - rcnamespace='namespaces', rcstart='start', - rctype='changetype', showAnon='anon', showBot='bot', - showMinor='minor', showPatrolled='patrolled', - showRedirects='redirect', topOnly='top_only') def recentchanges(self, *, start=None, end=None, @@ -1306,8 +1270,6 @@ rcgen.request['rctag'] = tag return rcgen
- @deprecated_args(number='total', step=True, key='searchstring', - getredirects=True, get_redirects=True) def search(self, searchstring: str, *, namespaces=None, where: str = 'text', @@ -1363,7 +1325,6 @@ total=total, g_content=content) return srgen
- @deprecated_args(step=True, showMinor='minor') def usercontribs(self, user=None, userprefix=None, start=None, end=None, reverse=False, namespaces=None, minor=None, total: Optional[int] = None, top_only=False): @@ -1420,8 +1381,6 @@ ucgen.request['ucshow'] = option_set return ucgen
- @deprecated_args(step=True, showMinor='minor', showAnon='anon', - showBot='bot') def watchlist_revs(self, start=None, end=None, reverse=False, namespaces=None, minor=None, bot=None, anon=None, total=None): @@ -1486,8 +1445,6 @@ or self.has_right('undelete'))): raise UserRightsError(err + 'deleted content.')
- @deprecated_args(step=True, get_text='content', page='titles', - limit='total') def deletedrevs(self, titles=None, start=None, end=None, reverse: bool = False, content=False, total=None, **kwargs): @@ -1666,7 +1623,6 @@ 'ususers': usernames, 'usprop': usprop}) return usgen
- @deprecated_args(step=True) def randompages(self, total=None, namespaces=None, redirects=False, content=False): """Iterate a number of random pages. @@ -1723,7 +1679,6 @@ }
@need_right('patrol') - @deprecated_args(token=True) def patrol(self, rcid=None, revid=None, revision=None): """Return a generator of patrolled pages.
@@ -1806,10 +1761,6 @@
yield result['patrol']
- @deprecated_args(number='total', repeat=True, namespace='namespaces', - rcshow=True, rc_show=True, get_redirect=True, step=True, - showBot='bot', showRedirects='redirect', - showPatrolled='patrolled') def newpages(self, user=None, returndict=False, start=None, end=None, reverse=False, bot=False, redirect=False, excludeuser=None, @@ -1855,8 +1806,6 @@ '', pageitem['user'], pageitem['comment'])
@deprecated('APISite.logevents(logtype="upload")', since='20170619') - @deprecated_args(lestart='start', leend='end', leuser='user', letitle=True, - repeat=True, number='total', step=True) def newfiles(self, user=None, start=None, end=None, reverse=False, total=None): """Yield information about newly uploaded files. @@ -1896,7 +1845,6 @@ type_arg='querypage', gqppage=special_page, total=total)
- @deprecated_args(number='total', step=True, repeat=True) def longpages(self, total=None): """Yield Pages and lengths from Special:Longpages.
@@ -1911,7 +1859,6 @@ yield (pywikibot.Page(self, pageitem['title']), int(pageitem['value']))
- @deprecated_args(number='total', step=True, repeat=True) def shortpages(self, total=None): """Yield Pages and lengths from Special:Shortpages.
@@ -1926,7 +1873,6 @@ yield (pywikibot.Page(self, pageitem['title']), int(pageitem['value']))
- @deprecated_args(number='total', step=True, repeat=True) def deadendpages(self, total=None): """Yield Page objects retrieved from Special:Deadendpages.
@@ -1934,7 +1880,6 @@ """ return self.querypage('Deadendpages', total)
- @deprecated_args(number='total', step=True, repeat=True) def ancientpages(self, total=None): """Yield Pages, datestamps from Special:Ancientpages.
@@ -1947,7 +1892,6 @@ yield (pywikibot.Page(self, pageitem['title']), pywikibot.Timestamp.fromISOformat(pageitem['timestamp']))
- @deprecated_args(number='total', step=True, repeat=True) def lonelypages(self, total=None): """Yield Pages retrieved from Special:Lonelypages.
@@ -1955,7 +1899,6 @@ """ return self.querypage('Lonelypages', total)
- @deprecated_args(number='total', step=True, repeat=True) def unwatchedpages(self, total=None): """Yield Pages from Special:Unwatchedpages (requires Admin privileges).
@@ -1963,7 +1906,6 @@ """ return self.querypage('Unwatchedpages', total)
- @deprecated_args(step=True) def wantedpages(self, total=None): """Yield Pages from Special:Wantedpages.
@@ -1985,7 +1927,6 @@ """ return self.querypage('Wantedtemplates', total)
- @deprecated_args(number='total', step=True, repeat=True) def wantedcategories(self, total=None): """Yield Pages from Special:Wantedcategories.
@@ -1993,7 +1934,6 @@ """ return self.querypage('Wantedcategories', total)
- @deprecated_args(number='total', step=True, repeat=True) def uncategorizedcategories(self, total=None): """Yield Categories from Special:Uncategorizedcategories.
@@ -2001,7 +1941,6 @@ """ return self.querypage('Uncategorizedcategories', total)
- @deprecated_args(number='total', step=True, repeat=True) def uncategorizedimages(self, total=None): """Yield FilePages from Special:Uncategorizedimages.
@@ -2012,7 +1951,6 @@ # synonym uncategorizedfiles = uncategorizedimages
- @deprecated_args(number='total', step=True, repeat=True) def uncategorizedpages(self, total=None): """Yield Pages from Special:Uncategorizedpages.
@@ -2020,7 +1958,6 @@ """ return self.querypage('Uncategorizedpages', total)
- @deprecated_args(number='total', step=True, repeat=True) def uncategorizedtemplates(self, total=None): """Yield Pages from Special:Uncategorizedtemplates.
@@ -2028,7 +1965,6 @@ """ return self.querypage('Uncategorizedtemplates', total)
- @deprecated_args(number='total', step=True, repeat=True) def unusedcategories(self, total=None): """Yield Category objects from Special:Unusedcategories.
@@ -2036,7 +1972,6 @@ """ return self.querypage('Unusedcategories', total)
- @deprecated_args(extension=True, number='total', step=True, repeat=True) def unusedfiles(self, total=None): """Yield FilePage objects from Special:Unusedimages.
@@ -2044,7 +1979,6 @@ """ return self.querypage('Unusedimages', total)
- @deprecated_args(number='total', step=True, repeat=True) def withoutinterwiki(self, total=None): """Yield Pages without language links from Special:Withoutinterwiki.
@@ -2052,7 +1986,6 @@ """ return self.querypage('Withoutinterwiki', total)
- @deprecated_args(step=True) def broken_redirects(self, total=None): """Yield Pages with broken redirects from Special:BrokenRedirects.
@@ -2060,7 +1993,6 @@ """ return self.querypage('BrokenRedirects', total)
- @deprecated_args(step=True) def double_redirects(self, total=None): """Yield Pages with double redirects from Special:DoubleRedirects.
@@ -2068,7 +2000,6 @@ """ return self.querypage('DoubleRedirects', total)
- @deprecated_args(step=True) def redirectpages(self, total=None): """Yield redirect pages from Special:ListRedirects.
@@ -2076,7 +2007,6 @@ """ return self.querypage('Listredirects', total)
- @deprecated_args(lvl='level') def protectedpages(self, namespace=0, type='edit', level=False, total=None): """ @@ -2126,7 +2056,6 @@ return self._generator(api.PageGenerator, type_arg='pageswithprop', gpwppropname=propname, total=total)
- @deprecated_args(step=True, sysop=True) def watched_pages(self, force=False, total=None): """ Return watchlist. diff --git a/pywikibot/specialbots/_upload.py b/pywikibot/specialbots/_upload.py index 92d9c4f..f3babaf 100644 --- a/pywikibot/specialbots/_upload.py +++ b/pywikibot/specialbots/_upload.py @@ -25,7 +25,6 @@ from pywikibot.backports import List from pywikibot.bot import BaseBot, QuitKeyboardInterrupt from pywikibot.exceptions import APIError, FatalServerError, NoPageError -from pywikibot.tools import deprecated_args from pywikibot.tools.formatter import color_format
@@ -33,10 +32,6 @@
"""Upload bot."""
- @deprecated_args(urlEncoding='url_encoding', useFilename='use_filename', - keepFilename='keep_filename', - verifyDescription='verify_description', - ignoreWarning='ignore_warning', targetSite='target_site') def __init__(self, url: Union[List[str], str], *, url_encoding=None, description: str = '', diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py index 172d9bb..71b7a1d 100644 --- a/pywikibot/throttle.py +++ b/pywikibot/throttle.py @@ -17,7 +17,7 @@
from pywikibot import config
-from pywikibot.tools import deprecated, deprecated_args, PYTHON_VERSION +from pywikibot.tools import deprecated, PYTHON_VERSION
if PYTHON_VERSION < (3, 6): from hashlib import md5 @@ -51,7 +51,6 @@
"""
- @deprecated_args(multiplydelay=True) def __init__(self, site, *, mindelay: Optional[int] = None, maxdelay: Optional[int] = None, diff --git a/pywikibot/titletranslate.py b/pywikibot/titletranslate.py index e3e72d5..9812ff6 100644 --- a/pywikibot/titletranslate.py +++ b/pywikibot/titletranslate.py @@ -6,10 +6,8 @@ # import pywikibot from pywikibot import config, date -from pywikibot.tools import deprecated_args
-@deprecated_args(family=True) def translate(page=None, hints=(), auto=True, removebrackets=False, site=None) -> list: """ diff --git a/pywikibot/tools/djvu.py b/pywikibot/tools/djvu.py index 8b2a922..3474f5f 100644 --- a/pywikibot/tools/djvu.py +++ b/pywikibot/tools/djvu.py @@ -1,7 +1,7 @@ #!/usr/bin/python """Wrapper around djvulibre to access djvu files properties and content.""" # -# (C) Pywikibot team, 2015-2020 +# (C) Pywikibot team, 2015-2021 # # Distributed under the terms of the MIT license. # @@ -11,7 +11,6 @@ from collections import Counter
import pywikibot -from pywikibot.tools import deprecated_args
def _call_cmd(args, lib='djvulibre') -> tuple: @@ -58,7 +57,6 @@
"""
- @deprecated_args(file_djvu='file') def __init__(self, file: str): """ Initializer. diff --git a/pywikibot/userinterfaces/terminal_interface_base.py b/pywikibot/userinterfaces/terminal_interface_base.py index e55d002..83d6684 100755 --- a/pywikibot/userinterfaces/terminal_interface_base.py +++ b/pywikibot/userinterfaces/terminal_interface_base.py @@ -22,7 +22,6 @@ StandardOption, ) from pywikibot.logging import INFO, INPUT, STDOUT, VERBOSE, WARNING -from pywikibot.tools import deprecated_args from pywikibot.userinterfaces import transliteration from pywikibot.userinterfaces._interface_base import ABUIC
@@ -481,7 +480,6 @@ # create a class-level lock that can be shared by all instances sharedlock = threading.RLock()
- @deprecated_args(strm='stream') def __init__(self, UI, stream=None): """Initialize the handler.
diff --git a/tests/site_tests.py b/tests/site_tests.py index 6a2da89..ef485a5 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -2687,12 +2687,6 @@ self.assertEqual('File:' + item['name'].replace('_', ' '), item['title'])
- def test_filearchive_limit(self): - """Test deprecated limit parameter.""" - fa = list(self.site.filearchive(limit=10)) - self.assertOneDeprecation() - self.assertLessEqual(len(fa), 10) - def test_filearchive_prefix(self): """Test prefix parameter.""" gen = self.site.filearchive(prefix='py')
pywikibot-commits@lists.wikimedia.org