jayvdb created this task. jayvdb added a subscriber: jayvdb. jayvdb added a project: pywikibot-core. Restricted Application added subscribers: Aklapper, pywikipedia-bugs.
TASK DESCRIPTION There are several scripts which run on wikis where they are not configured to run. The configuration for these scripts needs to be overhauled.
TASK DETAIL https://phabricator.wikimedia.org/T94679
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb Cc: pywikipedia-bugs, jayvdb, Aklapper
XZise added a subscriber: XZise. XZise added a comment.
Okay maybe this could be solved similar to https://gerrit.wikimedia.org/r/#/c/201446/1 . The script just defines a class or so which takes some keyword arguments. Each Wiki has then a `MediaWiki:FOO.js` JSON content (where FOO could be defined by the script or maybe `pywikibot-<scriptname>`). It then loads the JSON content and calls whatever is there to initialize the settings. So in the case of my patch the page would contain then on the English Wikipedia:
{ "name": "Orphan", "aliases": ["wi"], "parameters": "date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}" }
And it would do then something like that in the script:
settings_page = 'pywikibot-lonelypages' pywikibot.bot.load_settings(settings_page, OrphanTemplate)
And then in the library we have a function which does some magic:
def load_settings(page_title, callback, site=None): site = site or pywikibot.Site() page = pywikibot.Page(site, page_title + '.js', 12) if page.exists(): return callback(**json.loads(page.get())) else: return False
TASK DETAIL https://phabricator.wikimedia.org/T94679
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: XZise Cc: XZise, jayvdb, Aklapper, pywikipedia-bugs
XZise added a comment.
We could do something similar also to implement some family configuration variables (like where the categories/interwiki links go) like suggested in T89451: Reducing complexity of the Family class https://phabricator.wikimedia.org/T89451.
TASK DETAIL https://phabricator.wikimedia.org/T94679
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: XZise Cc: XZise, jayvdb, Aklapper, pywikipedia-bugs
gerritbot added a subscriber: gerritbot. gerritbot added a comment.
Change 201446 had a related patch set uploaded (by XZise): [FEAT] Load the settings from wiki
https://gerrit.wikimedia.org/r/201446
TASK DETAIL https://phabricator.wikimedia.org/T94679
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: gerritbot Cc: gerritbot, XZise, jayvdb, Aklapper, pywikipedia-bugs
gerritbot added a project: Patch-For-Review.
TASK DETAIL https://phabricator.wikimedia.org/T94679
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: gerritbot Cc: gerritbot, XZise, jayvdb, Aklapper, pywikipedia-bugs
pywikipedia-bugs@lists.wikimedia.org