jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1108156?usp=email )
Change subject: cleanup: remove old deprecation variables ......................................................................
cleanup: remove old deprecation variables
- remove deprecated variables which where added in Pywikibot 6.0 and before. A deprecation warning was already thrown. There is a generic warning if they are still used. - remove _future_variables and add content to _deprecated_variables. _future_variables were added with 4.0 for imports from __future__ but they are obsolete with sundown of Python 2. Add them to deprecation warning. - fix deprecation warning
Change-Id: Ib0df1ae4ebcd3576afd245eec754462bd4c27f8a --- M pywikibot/config.py 1 file changed, 8 insertions(+), 15 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/config.py b/pywikibot/config.py index cabc17c..55e1916 100644 --- a/pywikibot/config.py +++ b/pywikibot/config.py @@ -102,21 +102,14 @@ # exported to other modules.
_private_values = {'authenticate', 'db_password'} +# _deprecated_variables contains deprecated config variables which are +# no longer used. The values of this dict is the Pywikibot version of +# the deprecation but unused. _deprecated_variables = { - 'available_ssl_project', 'copyright_check_in_source_google', - 'copyright_check_in_source_msn', 'copyright_check_in_source_section_names', - 'copyright_check_in_source_yahoo', 'copyright_connection_tries', - 'copyright_economize_query', 'copyright_exceeded_in_queries', - 'copyright_exceeded_in_queries_sleep_hours', 'copyright_google', - 'copyright_max_query_for_page', 'copyright_msn', 'copyright_show_date', - 'copyright_show_length', 'copyright_skip_query', 'copyright_yahoo', - 'db_hostname', 'deIndentTables', 'fake_user_agent', 'flickr', - 'interwiki_contents_on_disk', 'line_separator', 'LS', 'msn_appid', - 'panoramio', 'persistent_http', 'proxy', 'special_page_limit', - 'splitLongParagraphs', 'sysopnames', 'use_mwparserfromhell', - 'use_SSL_onlogin', 'use_SSL_always', 'yahoo_appid', + 'absolute_import': '10.0.0 ', + 'division': '10.0.0', + 'unicode_literals': '10.0.0', } -_future_variables = {'absolute_import', 'division', 'unicode_literals'}
# ############# ACCOUNT SETTINGS ##############
@@ -998,7 +991,7 @@
DEPRECATED_VARIABLE = ( - f'"{{}}" present in our {user_config_file} is no longer a supported' + f'"{{}}" present in your {user_config_file} is no longer a supported' ' configuration variable and should be removed. Please inform the' ' maintainers if you depend on it.' ) @@ -1026,7 +1019,7 @@ if name in _deprecated_variables: warn('\n' + fill(DEPRECATED_VARIABLE.format(name)), _ConfigurationDeprecationWarning) - elif name not in _future_variables: + else: warn('\n' + fill(f'Configuration variable "{name}" is defined ' f'in your {user_config_file} but unknown. It' ' can be a misspelled one or a variable that'
pywikibot-commits@lists.wikimedia.org