Skip to content

Commit

Permalink
Update wiki.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Gelbpunkt committed Oct 8, 2018
1 parent 14c3d05 commit b2793ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions async_mediawiki/wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def __init__(self, base_url: str, session=None, loop=None, test=True):
if not base_url.endswith("api.php"):
raise BadWikiUrl("The wiki URL doesn\'t end with \'api.php\'. Add test=True if you want to skip this warning")

@classmethod
def wikipedia(cls, language="en", *args, **kwargs):
return cls(f"https://{language.lower()}.wikipedia.org/w/api.php", *args, **kwargs)

async def close(self):
"""Close the aiohttp Session"""
await self.session.close()
Expand Down

0 comments on commit b2793ad

Please sign in to comment.