jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/986520?usp=email )
Change subject: [IMPR] Add config.base_dir to scripts search path
......................................................................
[IMPR] Add config.base_dir to scripts search path
Bug: T324287
Change-Id: I0d6a2d86daadee499df863ff1886ac799a9c03db
---
M pywikibot/scripts/wrapper.py
1 file changed, 16 insertions(+), 5 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/scripts/wrapper.py b/pywikibot/scripts/wrapper.py
index 5b08cc8..e0d8bed 100755
--- a/pywikibot/scripts/wrapper.py
+++ b/pywikibot/scripts/wrapper.py
@@ -44,7 +44,6 @@
#
from __future__ import annotations
-#
import os
import sys
import types
@@ -379,6 +378,8 @@
.. versionchanged:: 7.0
Search users_scripts_paths in config.base_dir
+ .. versionchanged:: 9.0
+ Add config.base_dir to search path
"""
from pywikibot import config
path_list = [] # paths to find misspellings
@@ -394,14 +395,14 @@
path_list.append(testpath.parent)
return None
- user_script_paths = []
+ user_script_paths = ['']
if config.user_script_paths: # pragma: no cover
if isinstance(config.user_script_paths, list):
- user_script_paths = config.user_script_paths
+ user_script_paths += config.user_script_paths
else:
warn("'user_script_paths' must be a list,\n"
- 'found: {}. Ignoring this setting.'
- .format(type(config.user_script_paths)))
+ f'found: {type(config.user_script_paths).__name__}.'
+ ' Ignoring this setting.')
found = test_paths(user_script_paths, Path(config.base_dir))
if found: # pragma: no cover
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/986520?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I0d6a2d86daadee499df863ff1886ac799a9c03db
Gerrit-Change-Number: 986520
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: Mpaa <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]