jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/649384 )
Change subject: [cleanup] Remove desupported Family methods and attributes ......................................................................
[cleanup] Remove desupported Family methods and attributes
- remove nocapitalize attribute - remove shared_image_repository method
Bug: T89451 Change-Id: Ia613f763f5180dba6ec07b766ef606958bdd0334 --- M pywikibot/families/omegawiki_family.py M pywikibot/families/wikipedia_family.py M pywikibot/families/wiktionary_family.py M pywikibot/family.py M pywikibot/site/_basesite.py M tests/site_tests.py 6 files changed, 1 insertion(+), 77 deletions(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/families/omegawiki_family.py b/pywikibot/families/omegawiki_family.py index 8edd09c..eecdd45 100644 --- a/pywikibot/families/omegawiki_family.py +++ b/pywikibot/families/omegawiki_family.py @@ -16,10 +16,6 @@ name = 'omegawiki' domain = 'www.omegawiki.org'
- # On most Wikipedias page names must start with a capital letter, but some - # languages don't use this. - nocapitalize = ['omegawiki'] - def scriptpath(self, code): """Return the script path for this family.""" return '' diff --git a/pywikibot/families/wikipedia_family.py b/pywikibot/families/wikipedia_family.py index ee0371b..8cc954f 100644 --- a/pywikibot/families/wikipedia_family.py +++ b/pywikibot/families/wikipedia_family.py @@ -142,10 +142,6 @@ 'zh-classical', 'zh-min-nan', 'zh-yue', 'zu', ]
- # On most Wikipedias page names must start with a capital letter, - # but some languages don't use this. - nocapitalize = ['jbo'] - # Languages that used to be coded in iso-8859-1 latin1old = { 'af', 'bs', 'co', 'cs', 'da', 'de', 'en', 'es', 'es', 'et', 'eu', 'fi', diff --git a/pywikibot/families/wiktionary_family.py b/pywikibot/families/wiktionary_family.py index 938fe2e..4d23a4e 100644 --- a/pywikibot/families/wiktionary_family.py +++ b/pywikibot/families/wiktionary_family.py @@ -70,12 +70,6 @@ 'yi', 'zh', 'zh-min-nan', 'zu', ]
- # Other than most Wikipedias, page names must not start with a capital - # letter on ALL Wiktionaries. - @classproperty - def nocapitalize(cls): - return list(cls.langs.keys()) - # Which languages have a special order for putting interlanguage links, # and what order is it? If a language is not in interwiki_putfirst, # alphabetical order on language code is used. For languages that are in diff --git a/pywikibot/family.py b/pywikibot/family.py index 7d79448..947119e 100644 --- a/pywikibot/family.py +++ b/pywikibot/family.py @@ -24,7 +24,6 @@ from pywikibot.tools import ( classproperty, deprecated, deprecated_args, frozenmap, issue_deprecation_warning, ModuleDeprecationWrapper, PYTHON_VERSION, - remove_last_args, )
if PYTHON_VERSION >= (3, 9): @@ -504,10 +503,6 @@ # 'en': "Disambiguation" disambcatname = {} # type: Dict[str, str]
- # DEPRECATED, stores the code of the site which have a case sensitive - # main namespace. Use the Namespace given from the Site instead - nocapitalize = [] # type: List[str] - # attop is a list of languages that prefer to have the interwiki # links at the top of the page. interwiki_attop = [] # type: List[str] @@ -660,22 +655,11 @@ class variable. Only penalize getting it because it must be set so that the backwards compatibility is still available. """ - if name == 'nocapitalize': - issue_deprecation_warning('nocapitalize', - "APISite.siteinfo['case'] or " - "Namespace.case == 'case-sensitive'", - warning_class=FutureWarning, - since='20150214') - elif name == 'known_families': + if name == 'known_families': issue_deprecation_warning('known_families', 'APISite.interwiki(prefix)', warning_class=FutureWarning, since='20150503') - elif name == 'shared_data_repository': - issue_deprecation_warning('shared_data_repository', - 'APISite.data_repository()', - warning_class=FutureWarning, - since='20151023') return super().__getattribute__(name)
@staticmethod @@ -738,15 +722,6 @@ Family._families[fam] = cls return cls
- @classproperty - @deprecated('Family.codes or APISite.validLanguageLinks', since='20151014', - future_warning=True) - def iwkeys(cls): - """DEPRECATED: List of (interwiki_forward's) family codes.""" - if cls.interwiki_forward: - return list(pywikibot.Family(cls.interwiki_forward).langs.keys()) - return list(cls.langs.keys()) - @deprecated('APISite.interwiki', since='20151014', future_warning=True) def get_known_families(self, code): """DEPRECATED: Return dict of inter-family interwiki links.""" @@ -912,11 +887,6 @@ """Return path to api.php.""" return '%s/api.php' % self.scriptpath(code)
- @deprecated('APISite.article_path', since='20150905', future_warning=True) - def nicepath(self, code): - """DEPRECATED: Return nice path prefix, e.g. '/wiki/'.""" - return '/wiki/' - def eventstreams_host(self, code): """Hostname for EventStreams.""" raise NotImplementedError('This family does not support EventStreams') @@ -930,12 +900,6 @@ """Return the path to title using index.php with redirects disabled.""" return '%s?title=%s&redirect=no' % (self.path(code), title)
- @deprecated('APISite.nice_get_address(title)', since='20150628', - future_warning=True) - def nice_get_address(self, code, title): - """DEPRECATED: Return the nice path to title using index.php.""" - return '%s%s' % (self.nicepath(code), title) - def interface(self, code): """ Return interface to use for code. @@ -1066,15 +1030,6 @@ """Return the shared image repository, if any.""" return (None, None)
- # Deprecated via __getattribute__ - @remove_last_args(['transcluded']) - def shared_data_repository(self, code): - """Return the shared Wikibase repository, if any.""" - repo = pywikibot.Site(code, self).data_repository() - if repo is not None: - return repo.code, repo.family.name - return (None, None) - def isPublic(self, code): """Check the wiki require logging in before viewing it.""" return True diff --git a/pywikibot/site/_basesite.py b/pywikibot/site/_basesite.py index 493493f..ce95c52 100644 --- a/pywikibot/site/_basesite.py +++ b/pywikibot/site/_basesite.py @@ -100,18 +100,6 @@ self._locked_pages = set()
@property - @deprecated( - "APISite.siteinfo['case'] or Namespace.case == 'case-sensitive'", - since='20170504', future_warning=True) - def nocapitalize(self): - """ - Return whether this site's default title case is case-sensitive. - - DEPRECATED. - """ - return self.siteinfo['case'] == 'case-sensitive' - - @property def throttle(self): """Return this Site's throttle. Initialize a new one if needed.""" if not hasattr(self, '_throttle'): diff --git a/tests/site_tests.py b/tests/site_tests.py index b4758ea..ed9a4dd 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -48,11 +48,6 @@ self.assertEqual(self.site.case(), self.site.siteinfo['case']) self.assertOneDeprecationParts('pywikibot.site.APISite.case', 'siteinfo or Namespace instance') - self.assertIs(self.site.nocapitalize, - self.site.siteinfo['case'] == 'case-sensitive') - self.assertOneDeprecationParts( - 'pywikibot.site._basesite.BaseSite.nocapitalize', - "APISite.siteinfo['case'] or Namespace.case == 'case-sensitive'")
def test_siteinfo_normal_call(self): """Test calling the Siteinfo without setting dump."""
pywikibot-commits@lists.wikimedia.org