Hi,

I have shown several ways to determine the user account to be used with my previous mail. Your workarround is interesting: instead of having different directories to specify the user-config.py file it c/would be usefull to have an option like -config to specify the user config file name directly like -config:myconfig or -config:myotherconfig.py. What do you think about this proposal?

Greetings
xqt
 
Von: Johnuniq <wp.johnuniq@gmail.com>
Gesendet: 08.09.2022 11:19
An: <info@gno.de>
Kopie: Pywikibot discussion list <pywikibot@lists.wikimedia.org>
Betreff: Re: [pywikibot] Re: authenticate as bot and sysop
 
I did not do anything clever. I just copied user-config.py from the
pywikibot directory[1] to my own directory. I did that twice, using
different names like user-config-one.py and user-config-two.py. Then I
edited the two files to how I wanted. Each had a different user
configured for the same family and language. Then I put a very simple
script (shell/batch/Python, whatever is easy) in a PATH directory.
Before running my pywikibot script, I would run the simple script to
copy the appropriate config file to the pywikibot directory. I would
then run the pywikibot login script to login, then run my bot program.
I did not need to do that often, and I did not need to change users
often, so it was not difficult to take those extra steps.

[1] https://www.mediawiki.org/wiki/Manual:Pywikibot/user-config.py

On Thu, Sep 8, 2022 at 5:58 PM <info@gno.de> wrote:
>
>
>
> Sorry I cannot follow this approach. Can you explain?
>
> Best
>
> xqt
> Von: Johnuniq <wp.johnuniq@gmail.com>
> Gesendet: 08.09.2022 09:23
> An: Pywikibot discussion list <pywikibot@lists.wikimedia.org>
> Betreff: [pywikibot] Re: authenticate as bot and sysop
>
> > how You use different configs in the same script?
>
> In my case, I would first run a script to select which user I needed
> and that script copied the appropriate user-config file. After that, I
> would run a second script that used pywikibot. I have not tried
> YiFei Zhu's solution.
> _______________________________________________
> pywikibot mailing list -- pywikibot@lists.wikimedia.org
> To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org
</pywikibot@lists.wikimedia.org></wp.johnuniq@gmail.com></info@gno.de>