_endpointscfg_setup.py 文件源码

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

项目:endpoints-python 作者: cloudendpoints 项目源码 文件源码
def _SetupPaths():
  """Sets up the sys.path with special directories for endpointscfg.py."""
  sdk_path = _FindSdkPath()
  if sdk_path:
    sys.path.append(sdk_path)
    try:
      import dev_appserver  # pylint: disable=g-import-not-at-top
      if hasattr(dev_appserver, 'fix_sys_path'):
        dev_appserver.fix_sys_path()
      else:
        logging.warning(_NO_FIX_SYS_PATH_WARNING)
    except ImportError:
      logging.warning(_IMPORT_ERROR_WARNING)
  else:
    logging.warning(_NOT_FOUND_WARNING)

  # Add the path above this directory, so we can import the endpoints package
  # from the user's app code (rather than from another, possibly outdated SDK).
  # pylint: disable=g-import-not-at-top
  from google.appengine.ext import vendor
  vendor.add(os.path.dirname(os.path.dirname(__file__)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号