gam.py 文件源码

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

项目:GAMADV-XTD 作者: taers232c 项目源码 文件源码
def readDiscoveryFile(api_version):
  disc_filename = u'%s.json' % (api_version)
  disc_file = os.path.join(GM.Globals[GM.GAM_PATH], disc_filename)
  if hasattr(sys, u'_MEIPASS'):
    pyinstaller_disc_file = os.path.join(sys._MEIPASS, disc_filename)
  else:
    pyinstaller_disc_file = None
  if os.path.isfile(disc_file):
    json_string = readFile(disc_file, continueOnError=True, displayError=True)
  elif pyinstaller_disc_file:
    json_string = readFile(pyinstaller_disc_file, continueOnError=True, displayError=True)
  else:
    json_string = None
  if not json_string:
    invalidDiscoveryJsonExit(disc_file)
  try:
    discovery = json.loads(json_string)
    return (disc_file, discovery)
  except ValueError:
    invalidDiscoveryJsonExit(disc_file)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号