valhallasw added a comment.
I've thought a bit about what a sensible user interface would look like.
First an assumption: I think our code internally never uses the 'en:wikipedia' -> set family to 'commons' -> 'en:commons' -> 'commons:commons' magic. After all, otherwise wikidata wouldn't work at all. If this is **not** the case, I think we should **make** this the dase.
Then the only interface we have is the command line, where one can pass
1. -family:XX -lang:YY, or 2. -lang:YY, (implicit family), or 3. -family:XX (implicit lang)
My suggested behavior would be:
1. Always explicitly defines YY:XX. If that doesn't exist, we should raise an exception. So: - -family:wikidata -lang:wikidata gives wikidata:wikidata, but - -family:wikidata -lang:en raises an exception 2. is (1) where the family is specified in the user-config.py 3. a) if the family file does not specify a default: use the mylang specified in the user-config file, i.e. - mylang=en, -family:wiktionary --> en.wiktionary - mylang=ru, -family:myrandomwiki (where myrandomwiki does not specify a default, and does not have a ru site) --> error b) if the family file specifies a default, always use that default, so - mylang=test, -family:wikidata ->wikidata:wikidata [we can still reach test.wikidata with -family:wikidata -lang:wikidata]
for specifying what the default is, I think m4tx's implementation makes sense.
TASK DETAIL https://phabricator.wikimedia.org/T71255
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: m4tx, valhallasw Cc: pywikipedia-bugs, Ladsgroup, jayvdb, Mpaa, Ricordisamoa, XZise, Xqt, valhallasw