예제 #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
예제 #2
0
 def _construct_env(self, env, rest):
     for key in rest:
         if not key.startswith('env:'):
             raise RuntimeError("'%s' is not supported by this keyword." % key)
         if env is None:
             env = get_env_vars(upper=False)
         env[key[4:]] = rest[key]
     if env:
         env = dict((encode_to_system(key), encode_to_system(env[key]))
                    for key in env)
     return env
예제 #3
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("'%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
예제 #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]
예제 #5
0
 def _cmd(self, args, command, 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]
예제 #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))
예제 #7
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))