예제 #1
0
def execute(argv):
    if is_verbose_mode():
        print ' '.join(argv)
    try:
        output = subprocess.check_output(argv, stderr=subprocess.STDOUT)
        if is_verbose_mode():
            print output
        return output
    except subprocess.CalledProcessError as e:
        print e.output
        raise e
예제 #2
0
파일: util.py 프로젝트: 124521822/electron
def execute(argv, env=os.environ):
  if is_verbose_mode():
    print ' '.join(argv)
  try:
    output = subprocess.check_output(argv, stderr=subprocess.STDOUT, env=env)
    if is_verbose_mode():
      print output
    return output
  except subprocess.CalledProcessError as e:
    print e.output
    raise e
예제 #3
0
파일: util.py 프로젝트: kikecalpe/electron
def execute(argv, env=os.environ, cwd=None):
  if is_verbose_mode():
    print ' '.join(argv)
  try:
    output = subprocess.check_output(argv, stderr=subprocess.STDOUT, env=env, cwd=cwd)
    if is_verbose_mode():
      print output
    return output
  except subprocess.CalledProcessError as e:
    print e.output
    raise e
예제 #4
0
def start():
    dbusmock_log = sys.stdout if is_verbose_mode() else open(os.devnull, 'w')

    DBusTestCase.start_system_bus()
    DBusTestCase.spawn_server_template('logind', None, dbusmock_log)

    DBusTestCase.start_session_bus()
    DBusTestCase.spawn_server_template('notification_daemon', None, dbusmock_log)
예제 #5
0
def start():
    dbusmock_log = sys.stdout if is_verbose_mode() else open(os.devnull, 'w')

    DBusTestCase.start_system_bus()
    DBusTestCase.spawn_server_template('logind', None, dbusmock_log)

    DBusTestCase.start_session_bus()
    DBusTestCase.spawn_server_template('notification_daemon', None,
                                       dbusmock_log)
예제 #6
0
def execute_stdout(argv, env=os.environ, cwd=None):
    if is_verbose_mode():
        print ' '.join(argv)
        try:
            subprocess.check_call(argv, env=env, cwd=cwd)
        except subprocess.CalledProcessError as e:
            print e.output
            raise e
    else:
        execute(argv, env)
예제 #7
0
파일: util.py 프로젝트: 124521822/electron
def execute_stdout(argv, env=os.environ):
  if is_verbose_mode():
    print ' '.join(argv)
    try:
      subprocess.check_call(argv, env=env)
    except subprocess.CalledProcessError as e:
      print e.output
      raise e
  else:
    execute(argv, env)
예제 #8
0
def execute_stdout(argv):
    if is_verbose_mode():
        print ' '.join(argv)
        try:
            subprocess.check_call(argv)
        except subprocess.CalledProcessError as e:
            print e.output
            raise e
    else:
        execute(argv)
예제 #9
0
def update_node_modules(dirname, env=None):
    if env is None:
        env = os.environ.copy()
    if PLATFORM == 'linux':
        # Use prebuilt clang for building native modules.
        set_clang_env(env)
        env['npm_config_clang'] = '1'
    with scoped_cwd(dirname):
        args = [NPM, 'install']
        if is_verbose_mode():
            args += ['--verbose']
        # Ignore npm install errors when running in CI.
        if os.environ.has_key('CI'):
            try:
                execute_stdout(args, env)
            except subprocess.CalledProcessError:
                pass
        else:
            execute_stdout(args, env)
예제 #10
0
def update_node_modules(dirname, env=None):
  if env is None:
    env = os.environ.copy()
  if PLATFORM == 'linux':
    # Use prebuilt clang for building native modules.
    set_clang_env(env)
    env['npm_config_clang'] = '1'
  with scoped_cwd(dirname):
    args = [NPM, 'install']
    if is_verbose_mode():
      args += ['--verbose']
    # Ignore npm install errors when running in CI.
    if os.environ.has_key('CI'):
      try:
        execute_stdout(args, env)
      except subprocess.CalledProcessError:
        pass
    else:
      execute_stdout(args, env)
예제 #11
0
from config import is_verbose_mode
from dbusmock import DBusTestCase

import atexit
import os
import sys


def cleanup():
    DBusTestCase.stop_dbus(DBusTestCase.system_bus_pid)
    DBusTestCase.stop_dbus(DBusTestCase.session_bus_pid)


atexit.register(cleanup)

dbusmock_log = sys.stdout if is_verbose_mode() else open(os.devnull, 'w')

DBusTestCase.start_system_bus()
DBusTestCase.spawn_server_template('logind', None, dbusmock_log)

DBusTestCase.start_session_bus()
DBusTestCase.spawn_server_template('notification_daemon', None, dbusmock_log)