def run(self, options): "Run a command using your application's environment" self.read_env(options) cmd = ' '.join(options.command) p = Process(cmd, stdout=sys.stdout) p.wait()
def run(self, options): "Run a command using your application's environment" self.set_env(self.read_env(options)) cmd = ' '.join(shellquote(arg) for arg in options.command) p = Process(cmd, stdout=sys.stdout, stderr=sys.stderr) p.wait()
def run(self, options): "Run a command using your application's environment" self.set_env(self.read_env(options)) if compat.ON_WINDOWS: # do not quote on Windows, subprocess will handle it for us # using the MSFT quoting rules cmd = options.command else: cmd = ' '.join(shellquote(arg) for arg in options.command) p = Process(cmd, stdout=sys.stdout, stderr=sys.stderr) p.wait()
def command_run(args): procfile_path = _procfile_path(args.app_root, args.procfile) os.environ.update(_read_env(procfile_path, args.env)) if compat.ON_WINDOWS: # do not quote on Windows, subprocess will handle it for us # using the MSFT quoting rules cmd = args.command else: cmd = ' '.join(compat.shellquote(arg) for arg in args.command) p = Process(cmd, stdout=sys.stdout, stderr=sys.stderr) p.wait() sys.exit(p.returncode)
def test_wait(self): proc = Process('echo 123', popen=FakePopen) self.assertEqual(FakePopen.WAIT_RESULT, proc.wait())
def run(cmd): """Run a single command and exit""" p = Process(cmd, stdout=sys.stdout, stderr=sys.stderr) p.wait() print "finished running %s - returned %s" % (cmd, p.returncode)
def run(args): read_env(args) cmd = ' '.join(args.command) p = Process(cmd, stdout=sys.stdout) p.wait()