Python google.appengine.ext.vendor.add() Examples

The following are 1 code examples of google.appengine.ext.vendor.add(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module google.appengine.ext.vendor , or try the search function .
Example #1
Source File: _endpointscfg_setup.py    From endpoints-python with Apache License 2.0 6 votes vote down vote up
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__)))