Exemplo n.º 1
0
 def _construct_env(self, env, extra):
     if env:
         env = dict((encode_to_system(k), encode_to_system(v))
                    for k, v in env.items())
     for key in extra:
         if not key.startswith('env:'):
             raise RuntimeError("Keyword argument '%s' is not supported by "
                                "this keyword." % key)
         if env is None:
             env = os.environ.copy()
         env[encode_to_system(key[4:])] = encode_to_system(extra[key])
     return env
Exemplo n.º 2
0
 def _construct_env(self, env, extra):
     if env:
         env = dict((encode_to_system(k), encode_to_system(v))
                    for k, v in env.items())
     for key in extra:
         if not key.startswith('env:'):
             raise RuntimeError("Keyword argument '%s' is not supported by "
                                "this keyword." % key)
         if env is None:
             env = os.environ.copy()
         env[encode_to_system(key[4:])] = encode_to_system(extra[key])
     return env
Exemplo n.º 3
0
 def _cmd(self, command, args, use_shell):
     command = [encode_to_system(item) for item in [command] + list(args)]
     if not use_shell:
         return command
     if args:
         return subprocess.list2cmdline(command)
     return command[0]
Exemplo n.º 4
0
 def _cmd(self, command, args, use_shell):
     command = [encode_to_system(item) for item in [command] + list(args)]
     if not use_shell:
         return command
     if args:
         return subprocess.list2cmdline(command)
     return command[0]
Exemplo n.º 5
0
    def __str__(self):
        return encode_to_system("""\
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))
Exemplo n.º 6
0
    def __str__(self):
        return encode_to_system("""\
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))