Page MenuHomePhabricator

Rename -lang argument -langcode
Closed, ResolvedPublic

Description

The -lang argument gets captured by pywikibot before it reaches erfgoedbot. As a result we have had to rely on the lang = pywikibot.Site().language() hack.

We have attempted to address this before (patch, revert) but the above mentioned pywikibot capture mechanism meant this approach failed.

A fairly easy solution would be to rename -lang to -langcode then largely reuse the patch above. This change would however also require that we update all of the shell scripts, documentation, usage prompts, and readmes. We would also have to look over any cron jobs and the docker settings to make sure these are not affected.

The main benefit is that we become freed from pywikibot assumptions about which site we are working on (when harvesting we make an explicit connection) making e.g. testing less sensitive to the presence of a user-config and to changes in pywikibots default config.

Event Timeline

Change 356152 had a related patch set uploaded (by Lokal Profil; owner: Lokal Profil):
[labs/tools/heritage@wikidata] Rename -lang argument -langcode

https://gerrit.wikimedia.org/r/356152

I took a look in the bin files and the crontab. Neither contains the -lang flag. This is to be expected since they run over all datasets.

Change 356152 merged by jenkins-bot:
[labs/tools/heritage@wikidata] Rename -lang argument -langcode

https://gerrit.wikimedia.org/r/356152

Change 373878 had a related patch set uploaded (by Jean-Frédéric; owner: Lokal Profil):
[labs/tools/heritage@master] Rename -lang argument -langcode

https://gerrit.wikimedia.org/r/373878

Change 373878 merged by jenkins-bot:
[labs/tools/heritage@master] Rename -lang argument -langcode

https://gerrit.wikimedia.org/r/373878

Lokal_Profil claimed this task.