mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Fixed a bug
This commit is contained in:
parent
0c6820217c
commit
882f3ebbea
17
rcgcdw.py
17
rcgcdw.py
|
@ -1084,14 +1084,17 @@ class Recent_Changes_Class(object):
|
|||
startup_info = safe_read(self.safe_request(
|
||||
"https://{wiki}.gamepedia.com/api.php?action=query&format=json&uselang=content&list=tags|recentchanges&meta=allmessages&utf8=1&tglimit=max&tgprop=name|displayname&ammessages=recentchanges-page-added-to-category|recentchanges-page-removed-from-category&amenableparser=1&amincludelocal=1".format(
|
||||
wiki=settings["wiki"])), "query")
|
||||
if "tags" in startup_info and "allmessages" in startup_info:
|
||||
for tag in startup_info["tags"]:
|
||||
self.tags[tag["name"]] = (BeautifulSoup(tag["displayname"], "lxml")).get_text()
|
||||
for message in startup_info["allmessages"]:
|
||||
self.mw_messages[message["name"]] = message["*"]
|
||||
if startup_info:
|
||||
if "tags" in startup_info and "allmessages" in startup_info:
|
||||
for tag in startup_info["tags"]:
|
||||
self.tags[tag["name"]] = (BeautifulSoup(tag["displayname"], "lxml")).get_text()
|
||||
for message in startup_info["allmessages"]:
|
||||
self.mw_messages[message["name"]] = message["*"]
|
||||
else:
|
||||
logging.warning("Could not retrieve initial wiki information. Some features may not work correctly!")
|
||||
logging.debug(startup_info)
|
||||
else:
|
||||
logging.warning("Could not retrieve initial wiki information. Some features may not work correctly!")
|
||||
logging.debug(startup_info)
|
||||
logging.error("Could not retrieve initial wiki information. Possibly internet connection issue?")
|
||||
|
||||
|
||||
recent_changes = Recent_Changes_Class()
|
||||
|
|
Loading…
Reference in a new issue