Exemple #1
0
  port = option_dict[ARG_PORT]
  login_url = option_dict[ARG_LOGIN_URL]
  address = option_dict[ARG_ADDRESS]
  allow_skipped_files = option_dict[ARG_ALLOW_SKIPPED_FILES]
  static_caching = option_dict[ARG_STATIC_CACHING]
  persist_logs = option_dict[ARG_PERSIST_LOGS]
  skip_sdk_update_check = option_dict[ARG_SKIP_SDK_UPDATE_CHECK]

  if (option_dict[ARG_ADMIN_CONSOLE_SERVER] != '' and
      not dev_process.IsSubprocess()):

    server = MakeRpcServer(option_dict)
    if skip_sdk_update_check:
      logging.info('Skipping update check.')
    else:
      update_check = appcfg.UpdateCheck(server, appinfo)
      update_check.CheckSupportedVersion()
      if update_check.AllowedToCheckForUpdates():
        update_check.CheckForUpdates()

  if dev_process.IsSubprocess():
    logging.getLogger().setLevel(logging.WARNING)

  try:
    dev_appserver.SetupStubs(appinfo.application,
                             _use_atexit_for_datastore_stub=True,
                             **option_dict)
  except:
    exc_type, exc_value, exc_traceback = sys.exc_info()
    logging.error(str(exc_type) + ': ' + str(exc_value))
    logging.debug(''.join(traceback.format_exception(
    try:
        config, matcher = dev_appserver.LoadAppConfig(root_path, {})
    except yaml_errors.EventListenerError, e:
        logging.error('Fatal error when loading application configuration:\n' +
                      str(e))
        return 1
    except dev_appserver.InvalidAppConfigError, e:
        logging.error('Application configuration file invalid:\n%s', e)
        return 1

    if option_dict[ARG_ADMIN_CONSOLE_SERVER] != '':
        server = MakeRpcServer(option_dict)
        if skip_sdk_update_check:
            logging.info('Skipping update check.')
        else:
            update_check = appcfg.UpdateCheck(server, config)
            update_check.CheckSupportedVersion()
            if update_check.AllowedToCheckForUpdates():
                update_check.CheckForUpdates()

    try:
        dev_appserver.SetupStubs(config.application, **option_dict)
    except:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        logging.error(str(exc_type) + ': ' + str(exc_value))
        logging.debug(''.join(
            traceback.format_exception(exc_type, exc_value, exc_traceback)))
        return 1

    http_server = dev_appserver.CreateServer(
        root_path,