load.py 文件源码

python
阅读 38 收藏 0 点赞 0 评论 0

项目:HabZone 作者: Marginal 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号