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
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
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
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)
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)
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)
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)
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)
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)