jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/609525 )
Change subject: [cleanup] Remove deprecated Site methods ......................................................................
[cleanup] Remove deprecated Site methods
Remove oudated Site methods after several years. The FutureWarning was made before 3.0.20200405
Change-Id: I3fd9b1778165714a6f8baea1c12105de5ce191f3 --- M pywikibot/site/__init__.py 1 file changed, 0 insertions(+), 83 deletions(-)
Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site/__init__.py b/pywikibot/site/__init__.py index f7b20ab..9be6405 100644 --- a/pywikibot/site/__init__.py +++ b/pywikibot/site/__init__.py @@ -1108,19 +1108,6 @@ '{site.family.name}_family for {site}'.format(site=self)) return pywikibot.Category(pywikibot.Link(name, self))
- @deprecated('pywikibot.Link', since='20090307', future_warning=True) - def linkto(self, title, othersite=None): - """DEPRECATED. Return a wikilink to a page. - - @param title: Title of the page to link to - @type title: str - @param othersite: Generate a interwiki link for use on this site. - @type othersite: BaseSite or None - - @rtype: str - """ - return pywikibot.Link(title, self).astext(othersite) - def isInterwikiLink(self, text): """Return True if text is in the form of an interwiki link.
@@ -1236,11 +1223,6 @@
# deprecated methods for backwards-compatibility
- @deprecated('family attribute', since='20090307', future_warning=True) - def fam(self): - """Return Family object for this Site.""" - return self.family - @deprecated('pywikibot.data.api.encode_url', since='20151211') def urlEncode(self, query): """DEPRECATED.""" @@ -1998,21 +1980,6 @@
return True
- @deprecated('Site.user()', since='20090307', future_warning=True) - @remove_last_args(['sysop']) - def loggedInAs(self): - """Return the current username if logged in, otherwise return None. - - DEPRECATED (use .user() method instead) - - @param sysop: if True, test if user is logged in as the sysop user - instead of the normal user. - @type sysop: bool - - @rtype: bool - """ - return self.logged_in() and self.user() - def is_oauth_token_available(self): """ Check whether OAuth token is set for this site. @@ -4337,21 +4304,6 @@ apgen.request['gapdir'] = 'descending' return apgen
- @deprecated('Site.allpages()', since='20090307', future_warning=True) - def prefixindex(self, prefix, namespace=0, includeredirects=True): - """Yield all pages with a given prefix. Deprecated. - - Use allpages() with the prefix= parameter instead of this method. - """ - if not includeredirects: - filterredir = False - elif includeredirects == 'only': - filterredir = True - else: - filterredir = None - return self.allpages(prefix=prefix, namespace=namespace, - filterredir=filterredir) - @deprecated_args(step=None) def alllinks(self, start='!', prefix='', namespace=0, unique=False, fromids=False, total=None): @@ -4419,15 +4371,6 @@ acgen.request['gacdir'] = 'descending' return acgen
- @deprecated('Site.allcategories()', since='20090307', future_warning=True) - def categories(self, number=10, repeat=False): - """DEPRECATED.""" - if repeat: - limit = None - else: - limit = number - return self.allcategories(total=limit) - def isBot(self, username): """Return True is username is a bot user.""" return username in (userdata['name'] for userdata in self.botusers()) @@ -6262,32 +6205,6 @@ return all('linkupdate' in page for page in result) return True
- @deprecated('Site().exturlusage', since='20090529', future_warning=True) - def linksearch(self, siteurl, limit=None, euprotocol=None): - """Backwards-compatible interface to exturlusage().""" - return self.exturlusage(siteurl, total=limit, protocol=euprotocol) - - @deprecated('Site().allimages(sha1=hash_found)', since='20141219', - future_warning=True) - def getFilesFromAnHash(self, hash_found): - """ - Return all files that have the same hash. - - DEPRECATED: Use L{APISite.allimages} instead using 'sha1'. - """ - return [image.title(with_ns=False) - for image in self.allimages(sha1=hash_found)] - - @deprecated('Site().allimages(sha1=hash_found)', since='20141219', - future_warning=True) - def getImagesFromAnHash(self, hash_found): - """ - Return all images that have the same hash. - - DEPRECATED: Use L{APISite.allimages} instead using 'sha1'. - """ - return self.getFilesFromAnHash(hash_found) - @need_right('edit') def is_uploaddisabled(self): """Return True if upload is disabled on site.
pywikibot-commits@lists.wikimedia.org