def edsm_worker(systemName):
if not this.edsm_session:
this.edsm_session = requests.Session()
try:
r = this.edsm_session.get('https://www.edsm.net/api-system-v1/bodies?systemName=%s' % urllib2.quote(systemName), timeout=10)
r.raise_for_status()
this.edsm_data = r.json() or {} # Unknown system represented as empty list
except:
this.edsm_data = None
# Tk is not thread-safe, so can't access widgets in this thread.
# event_generate() is the only safe way to poke the main thread from this thread.
this.frame.event_generate('<<HabZoneData>>', when='tail')
# EDSM data received
评论列表
文章目录