Hi everyone,
My bot has started throwing the following error, and I'm wondering if
anyone has a clue about what might have changed. It's using the shared
stable version on ToolForge, which I believe was updated to 8.0.3. today.
TIA for any help.
File "/data/project/william-avery-bot/wikipythonics/cleanseRefs.py", line
118, in treat_page
self.current_page.editEntity(summary=summary)
File
"/data/project/shared/pywikibot/stable/pywikibot/page/_decorators.py", line
55, in wrapper
handle(func, self, *args, **kwargs)
File
"/data/project/shared/pywikibot/stable/pywikibot/page/_decorators.py", line
34, in handle
func(self, *args, **kwargs)
File "/data/project/shared/pywikibot/stable/pywikibot/page/_wikibase.py",
line 680, in editEntity
super().editEntity(data, **kwargs)
File "/data/project/shared/pywikibot/stable/pywikibot/page/_wikibase.py",
line 313, in editEntity
updates = self.repo.editEntity(
File
"/data/project/shared/pywikibot/stable/pywikibot/site/_decorators.py", line
92, in callee
return fn(self, *args, **kwargs)
File "/data/project/shared/pywikibot/stable/pywikibot/site/_datasite.py",
line 311, in editEntity
params['token'] = self.tokens['csrf']
File
"/data/project/shared/pywikibot/stable/pywikibot/site/_tokenwallet.py",
line 57, in __getitem__
raise KeyError(
KeyError: "Invalid token 'csrf' for user 'William Avery Bot' on
wikidata:wikidata wiki."
Hello everyone,
*Summary*
The Developer Advocacy team is excited to share with you a new set of
educational materials you can use to learn and teach others about Pywikibot
[1]. These new materials are based on content originally presented as part
of the Small wiki toolkits initiative [2]. Please read and share these
materials, give feedback in Phabricator [3] or on Talk pages, or edit the
pages directly if you find errors. This will help improve the materials for
these workshops as well as workshops planned for the future.
*Long version*
Last year, the Small wiki toolkits initiative held monthly technical
workshops about using, building, and hosting bots [4].
In response to feedback received from participants [5], this year the
Developer Advocacy team launched an initiative (Phabricator task: [6]) to
develop on-wiki learning and training materials based on the previous
workshops. The goal of these materials is to make it easier for you to
learn about Pywikibot and teach others in your community about it. Drafts
for two workshops [7] are now ready for your review:
- How to run basic scripts using Pywikibot
- How to host a bot on Toolforge
Materials for each workshop come in two formats:
1. Self-study guide
- explains how to learn a given subject on your own
- links to different resources on wikis and other sites without duplicating
them.
2. Workshop organizer's handbook
- teaches you how to teach the subject to others
- explains how to prepare a workshop that you can run during a hackathon or
a conference. If you've ever wanted to give a talk about Pywikibot but
didn't have the time to design it, the handbook should help.
*How to get involved*
Please read the linked materials and provide feedback in Phabricator or on
talk pages. Is this the right format for learners and trainers? Did we miss
anything? Are there sections that are difficult to follow or make no sense?
Please let us know. Your input will help inform the next steps for the
development of the remaining materials.
If you want to contribute any changes or corrections, you can do so either
directly on the pages, or by leaving comments on talk pages or in
Phabricator. Thank you for your help!
On behalf of the Developer Advocacy team,
Kamil Bach
[1] https://www.mediawiki.org/wiki/Manual:Pywikibot/Workshop_Materials
[2] https://meta.wikimedia.org/wiki/Small_wiki_toolkits/Workshops
[3] https://phabricator.wikimedia.org/T327282
[4] https://meta.wikimedia.org/wiki/Small_wiki_toolkits/Workshops
[5] https://meta.wikimedia.org/wiki/Small_wiki_toolkits/Workshops/Report
[6] https://phabricator.wikimedia.org/T327282
[7] https://www.mediawiki.org/wiki/Manual:Pywikibot/Workshop_Materials
--
Kamil Bach (they/them)
Technical Writer
Wikimedia Foundation
Hi,
I wrote a module which handles Flagged Revisions in huwiki.
https://hu.wikipedia.org/wiki/Szerkeszt%C5%91:BinBot/huwiki/flaggedrevs.py
It has a function called cosmeticable(page) to tell if a page is eligible
for cosmetic changes according to huwiki rules.
It also has a CosmeticableFilterPageGenerator which yields only
cosmeticable pages. But it may not have a command-line argument as it
is not in the framework.
Now, what is the way to tell Pywikibot that cosmetic changes should be done
only on pages where the function returns True or which are from this
pagegenerator?
I don't want to modify the core system on my device, because it will be
disrupted when refreshing and is not distributable to other users.
In eneral, is there a way to use own _global_ command-line arguments?
--
Bináris