Xqt added a comment.

  pywikibot.Site() already has some functionality you required, you can give 
the user account with it and login after it:
  
    D:\pwb\GIT\core>pwb shell
    Welcome to the Pywikibot interactive shell!
    >>> site = pywikibot.Site('wikipedia:de', user='xqt')
    >>> site.login()
    Password for user Xqt on wikipedia:de (no characters will be shown):
    Logging in to wikipedia:de as Xqt
    Bitte gib einen Verifizierungscode von deinem Authentifizierungsgerät ein.:
    >>> site.logged_in()
    True
    >>>
  
  
https://doc.wikimedia.org/pywikibot/master/api_ref/pywikibot.html#pywikibot.Site
  (The previous was a 2FA example)
  
  Also `site.login()` has a parameter to give the user name.
  
https://doc.wikimedia.org/pywikibot/master/api_ref/pywikibot.site.html#pywikibot.site._apisite.APISite.login
  
  You may use a bot password file for login parameters. `user-config.py` is 
recommended but not mandatory. You may have multiple config files using the 
`-config` global option. Global options can always be used even if you have 
your own option parser and you don't use `pywikibot.handle_args()` for example:
  
  `pwb [<global options>] <your script> [<script options>] `
  
  
https://doc.wikimedia.org/pywikibot/master/utilities/scripts_ref.html#module-pywikibot.scripts.wrapper
  https://doc.wikimedia.org/pywikibot/master/global_options.html#global-options

TASK DETAIL
  https://phabricator.wikimedia.org/T323852

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Xqt
Cc: Xqt, Aklapper, pywikibot-bugs-list, RPI2026F1, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, 
Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to