The docs for BasePage.get() say:
pywikibot.exceptions.IsRedirectPageError – The page is a redirect. The argument of the exception is the title of the page it redirects to.
but that doesn't seem to be what's actually happening:
> from pywikibot import Site, Page
> from pywikibot.exceptions import IsRedirectPageError
>
> site = Site("en")
>
> page = Page(site, "Template:shortdescription")
> try:
> print(page.get())
> except IsRedirectPageError as ex:
> print(f"{ex.args=}")
prints
> ex.args=(Page('Template:Shortdescription'),)
Am I just not understanding the doc correctly?
If I've got a Node out of Wikicode.filter(), is there a way to map that back to a location in the original parsed wikitext? Ideally, character offsets for the start and end of the text that makes up the Node.
I'm trying to single-step through pywikibot using vscode. I've got:
certifi==2024.2.2
charset-normalizer==3.3.2
idna==3.6
iniconfig==2.0.0
mwparserfromhell==0.6.6
packaging==23.2
pluggy==1.4.0
pytest==8.0.2
pytest-mock==3.12.0
pywikibot==8.6.0
requests==2.31.0
urllib3==2.2.1
vscode: Version: 1.87.1
MacOS Ventura 13.6.4
Python 3.11.8
I'm getting a bunch of Pylance errors (warnings?) _basepage.py of the form:
Variable not allowed in type expression
It seems to be complaining about the "Dict" in:
def protection(self) -> Dict[str, Tuple[str, str]]:
Any idea what's going on?
Dear Pywikibot Contributors,
I trust this message finds you well. My name is Abdulrhman Adel, and I'm
enthusiastic about the prospect of contributing to the Pywikibot project.
In my journey as a developer, I've had the opportunity to work on various
projects, including several Python projects developed for hackathons. One
of my most significant achievements is the creation of the A.I.S.L a Sign
Language Assistant. This bot was specifically designed to assist
individuals with sign language.
Pywikibot's role as a Python library and automation tool, developed for
Wikipedia, has captured my interest and I'm eager to contribute my skills
and insights to enhance Pywikibot's capabilities.
Feel free to explore my GitHub profile
<https://github.com/abdulrhman-adel/>and my repositories to gain insight
into my coding style and previous contributions.
Having reviewed the Pywikibot documentation and contributor guidelines, I
am enthusiastic about the prospect of getting involved. Could you please
provide guidance on the next steps or point me to tasks suitable for
newcomers?
Thank you for your time and consideration. I am looking forward to the
opportunity to collaborate with the Pywikibot community.
Best regards,
Abdulrhman Adel