Beispiel #1
0
def main():
    """Launches dev_appserver.py."""
    runtimes = wrapper_util.GetRuntimes(sys.argv[1:])
    components = wrapper_util.GetComponents(runtimes)
    options = wrapper_util.ParseDevAppserverFlags(sys.argv[1:])
    if options.support_datastore_emulator:
        components.append('cloud-datastore-emulator')
    update_manager.UpdateManager.EnsureInstalledAndRestart(components,
                                                           command=__file__)

    args = ['--skip_sdk_update_check=True']

    google_analytics_client_id = metrics.GetCIDIfMetricsEnabled()
    google_analytics_user_agent = metrics.GetUserAgentIfMetricsEnabled()
    if google_analytics_client_id:
        args.extend([
            '--google_analytics_client_id={}'.format(
                google_analytics_client_id),
            '--google_analytics_user_agent={}'.format(
                google_analytics_user_agent)
        ])

    # Pass the path to cloud datastore emulator to dev_appserver.
    sdk_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    emulator_dir = os.path.join(sdk_root, 'platform',
                                'cloud-datastore-emulator')
    emulator_script = ('cloud_datastore_emulator.cmd'
                       if platforms.OperatingSystem.IsWindows() else
                       'cloud_datastore_emulator')
    args.append('--datastore_emulator_cmd={}'.format(
        os.path.join(emulator_dir, emulator_script)))

    bootstrapping.ExecutePythonTool(
        os.path.join('platform', 'google_appengine'), 'dev_appserver.py',
        *args)
def main():
  """Launches dev_appserver.py."""
  runtimes = wrapper_util.GetRuntimes(sys.argv[1:])
  components = wrapper_util.GetComponents(runtimes)
  options = wrapper_util.ParseDevAppserverFlags(sys.argv[1:])
  if options.support_datastore_emulator:
    components.append('cloud-datastore-emulator')
  update_manager.UpdateManager.EnsureInstalledAndRestart(
      components,
      command=__file__)

  args = [
      '--skip_sdk_update_check=True'
  ]

  google_analytics_client_id = metrics.GetCIDIfMetricsEnabled()
  google_analytics_user_agent = metrics.GetUserAgentIfMetricsEnabled()
  if google_analytics_client_id:
    args.extend([
        '--google_analytics_client_id={}'.format(google_analytics_client_id),
        '--google_analytics_user_agent={}'.format(google_analytics_user_agent)
    ])

  bootstrapping.ExecutePythonTool(
      os.path.join('platform', 'google_appengine'), 'dev_appserver.py', *args)
Beispiel #3
0
def main():
    """Launches dev_appserver.py."""
    runtimes = wrapper_util.GetRuntimes(sys.argv[1:])
    components = wrapper_util.GetComponents(runtimes)
    update_manager.UpdateManager.EnsureInstalledAndRestart(components,
                                                           command=__file__)

    args = [
        '--skip_sdk_update_check=True',
        '--application={}'.format(properties.VALUES.core.project.Get())
    ]

    google_analytics_client_id = metrics.GetCIDIfMetricsEnabled()
    google_analytics_user_agent = metrics.GetUserAgentIfMetricsEnabled()
    if google_analytics_client_id:
        args.extend([
            '--google_analytics_client_id={}'.format(
                google_analytics_client_id),
            '--google_analytics_user_agent={}'.format(
                google_analytics_user_agent)
        ])

    bootstrapping.ExecutePythonTool(
        os.path.join('platform', 'google_appengine'), 'dev_appserver.py',
        *args)
Beispiel #4
0
def main():
  """Launches dev_appserver.py."""
  runtimes = wrapper_util.GetRuntimes(sys.argv[1:])
  components = wrapper_util.GetComponents(runtimes)
  update_manager.UpdateManager.EnsureInstalledAndRestart(
      components,
      command=__file__)

  args = [
      '--skip_sdk_update_check=True'
  ]

  bootstrapping.ExecutePythonTool(
      os.path.join('platform', 'google_appengine'), 'dev_appserver.py', *args)
Beispiel #5
0
def main():
  """Launches dev_appserver.py."""
  argv = bootstrapping.GetDecodedArgv()
  runtimes = wrapper_util.GetRuntimes(argv[1:])
  options = wrapper_util.ParseDevAppserverFlags(sys.argv[1:])
  if options.support_datastore_emulator:
    java.RequireJavaInstalled(datastore_util.DATASTORE_TITLE, min_version=8)
  components = wrapper_util.GetComponents(runtimes)
  components.append('cloud-datastore-emulator')
  if (platforms.OperatingSystem.Current() == platforms.OperatingSystem.LINUX
      and 'app-engine-php' in components):
    components.remove('app-engine-php')
  update_manager.UpdateManager.EnsureInstalledAndRestart(
      components,
      command=__file__)

  args = [
      '--skip_sdk_update_check=True'
  ]

  google_analytics_client_id = metrics.GetCIDIfMetricsEnabled()
  google_analytics_user_agent = metrics.GetUserAgentIfMetricsEnabled()
  if google_analytics_client_id:
    args.extend([
        '--google_analytics_client_id={}'.format(google_analytics_client_id),
        '--google_analytics_user_agent={}'.format(google_analytics_user_agent)
    ])

  # Pass the path to cloud datastore emulator to dev_appserver.
  # realpath is needed in the case where __file__ is a path containing symlinks.
  sdk_root = os.path.dirname(
      os.path.dirname(os.path.abspath(os.path.realpath(__file__))))
  emulator_dir = os.path.join(sdk_root, 'platform', 'cloud-datastore-emulator')
  emulator_script = (
      'cloud_datastore_emulator.cmd' if platforms.OperatingSystem.IsWindows()
      else 'cloud_datastore_emulator')
  args.append('--datastore_emulator_cmd={}'.format(
      os.path.join(emulator_dir, emulator_script)))

  bootstrapping.ExecutePythonTool(
      os.path.join('platform', 'google_appengine'), 'dev_appserver.py', *args)
Beispiel #6
0
 def testPythonExtras(self):
     self.assertEqual(
         wrapper_util.GetComponents(['python27', 'python27-libs']),
         ['app-engine-python', 'app-engine-python-extras'])
Beispiel #7
0
 def testMulti(self):
     self.assertEqual(
         wrapper_util.GetComponents(['php55', 'java7']),
         ['app-engine-python', 'app-engine-php', 'app-engine-java'])
Beispiel #8
0
 def testPython(self):
     self.assertEqual(wrapper_util.GetComponents(['python27']),
                      ['app-engine-python'])
Beispiel #9
0
 def testPhp(self):
     self.assertEqual(wrapper_util.GetComponents(['php55']),
                      ['app-engine-python', 'app-engine-php'])
Beispiel #10
0
 def testJava(self):
     self.assertEqual(wrapper_util.GetComponents(['java7']),
                      ['app-engine-python', 'app-engine-java'])
Beispiel #11
0
 def testDefaultComponents(self):
     self.assertEqual(wrapper_util.GetComponents([]), ['app-engine-python'])