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(
|
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(
|
"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")
|
wiki=settings["wiki"])), "query")
|
||||||
if "tags" in startup_info and "allmessages" in startup_info:
|
if startup_info:
|
||||||
for tag in startup_info["tags"]:
|
if "tags" in startup_info and "allmessages" in startup_info:
|
||||||
self.tags[tag["name"]] = (BeautifulSoup(tag["displayname"], "lxml")).get_text()
|
for tag in startup_info["tags"]:
|
||||||
for message in startup_info["allmessages"]:
|
self.tags[tag["name"]] = (BeautifulSoup(tag["displayname"], "lxml")).get_text()
|
||||||
self.mw_messages[message["name"]] = message["*"]
|
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:
|
else:
|
||||||
logging.warning("Could not retrieve initial wiki information. Some features may not work correctly!")
|
logging.error("Could not retrieve initial wiki information. Possibly internet connection issue?")
|
||||||
logging.debug(startup_info)
|
|
||||||
|
|
||||||
|
|
||||||
recent_changes = Recent_Changes_Class()
|
recent_changes = Recent_Changes_Class()
|
||||||
|
|
Loading…
Reference in a new issue