-
Notifications
You must be signed in to change notification settings - Fork 0
fix: restore pywikibot config access through wrapper import #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,7 +9,6 @@ | |||||
| from typing import Any | ||||||
|
|
||||||
| import mwparserfromhell | ||||||
| import pywikibot.config | ||||||
| import requests | ||||||
| from deepdiff import DeepDiff | ||||||
| from mwparserfromhell.wikicode import Wikicode | ||||||
|
|
@@ -28,6 +27,7 @@ | |||||
| from pywikibot.data.api import Request | ||||||
| from pywikibot.page import BasePage | ||||||
| from pywikibot.page._collections import ClaimCollection | ||||||
| from pywikibot.scripts.wrapper import pwb | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The import statement
Suggested change
|
||||||
| from redis import Redis | ||||||
|
|
||||||
| from wikibots.lib.wikidata import WikidataEntity, WikidataProperty | ||||||
|
|
@@ -71,11 +71,11 @@ def __init__(self, **kwargs: Any): | |||||
| _access_token, | ||||||
| _access_secret, | ||||||
| ) | ||||||
| pywikibot.config.authenticate["commons.wikimedia.org"] = authenticate | ||||||
| pwb.config.authenticate["commons.wikimedia.org"] = authenticate | ||||||
| else: | ||||||
| pywikibot.config.password_file = "user-password.py" | ||||||
| pwb.config.password_file = "user-password.py" | ||||||
|
|
||||||
| pywikibot.config.put_throttle = self.throttle | ||||||
| pwb.config.put_throttle = self.throttle | ||||||
|
|
||||||
| self.wikidata = Site("wikidata", "wikidata") | ||||||
| self.commons = Site("commons", "commons", user=os.getenv("PWB_USERNAME")) | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reference to the
tytool is missing backticks, which makes it look like a typo for 'the' or 'type'. Adding backticks clarifies that it refers to the command-line tool defined in the 'Commands' section of this document. Additionally, backtickingexit 0improves readability as it refers to a process exit code.