def get_command(self, command, arguments): command = [system_encode(item) for item in [command] + arguments] if not self.shell: return command if arguments: return subprocess.list2cmdline(command) return command[0]
def __str__(self): return system_encode("""\ cwd = %s stdout_stream = %s stderr_stream = %s shell = %r alias = %s env = %r""" % (self.cwd, self.stdout_stream, self.stderr_stream, self.shell, self.alias, self.env))
def _add_to_env(self, env, extra): for key in extra: if not key.startswith('env:'): raise RuntimeError("Keyword argument '%s' is not supported by " "this keyword." % key) env[system_encode(key[4:])] = system_encode(extra[key])
def _get_initial_env(self, env, extra): if env: return dict((system_encode(k), system_encode(env[k])) for k in env) if extra: return os.environ.copy() return None