Fixed a bug

This commit is contained in:
Frisk 2018-12-30 19:57:29 +01:00
parent 0c6820217c
commit 882f3ebbea
No known key found for this signature in database
GPG key ID: 0E9A7D3C0A01586C

View file

@ -1084,6 +1084,7 @@ 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 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()
@ -1092,6 +1093,8 @@ class Recent_Changes_Class(object):
else:
logging.warning("Could not retrieve initial wiki information. Some features may not work correctly!")
logging.debug(startup_info)
else:
logging.error("Could not retrieve initial wiki information. Possibly internet connection issue?")
recent_changes = Recent_Changes_Class()