Jump to content

User talk:Bináris/Pywikibot cookbook

Add topic
From mediawiki.org
Latest comment: 1 year ago by Xqt in topic Introduction

Introduction

[edit]

First of all, this is a great work! Thank you for it. Here are some points of my first review of the first chapter

Encoding and environment
IDLE shows line numbers. To enable it use Options -> Show Line Numbers.
To fast jump to a line number you may use the short cut alt+g.
Wher to put
I tmay be notable that user_script_paths also accepts absolute paths. For example my framework resides in D:/pwb/git/core and my scripts resides in D:/pwb/git/xqbot. The absolute path is added o use these scripts: user_script_paths = ['/pwb/git/xqbot'].
Running a script
To run scripts without pwb wrapper the PYTHONPATH must be set I guess or the subfolder must be included to the call: userscripts/myscript.
When registering .py with python, the call can be simplified as pwb ....
Coding style
PEP20, the zen of Python is also nice ;). And don't forget documentation.
Scripting vs interactive use
The shell script also starts a Python shell but imports pywikibot automatically. Another way to use a shell is via IDLE and using Run -> Python Shell (my prefered way but be aware: passwords are not hidden here)
Did you have introduced the -simulate option elsewhere?
Documentation and help
Be aware that documentation on mediawiki.org may be outdated especially if the content can be created easier by sphinx and placed at https://doc.wikimedia.org/pywikibot/stable/ then.

Thank you so much.  @xqt 06:57, 6 March 2023 (UTC)Reply

Dear Xqt, thank you for your help! I haven't noticed your contribution when I published the pages. Most of the sections is now live and public under Manual:Pywikibot/Cookbook. So could you please directly edit the pages? Feel free to do it at any time. Page histories will also go live today. I really wanted to ask your opinion and culd not find any better person to review the cookbook, so I really appreciate every correction and contribution. I never knew this about IDLE and I don't understand why this basic feature is not sitched on by default. Bináristalk 09:00, 7 March 2023 (UTC)Reply

I never used -simulate, and I don't know it. Could you please write about it? Bináristalk 09:06, 7 March 2023 (UTC)Reply

@Xqt: Could you please insert the cookbook into the Pywikibot template and the main page of the manual? I am very unfamiliar with these overcomplicated translate pages and I don't feel like learning them. Bináristalk 09:04, 7 March 2023 (UTC)Reply

I added the cookbook to the main page. I am not familar with the translation stuff too but seems we get some help [1].  @xqt 17:28, 8 March 2023 (UTC)Reply