80 endlog=None, keyword=None, kill_it=False, cwd=None, |
81 endlog=None, keyword=None, kill_it=False, cwd=None, |
81 encoding=None, output_encoding=None, env=None): |
82 encoding=None, output_encoding=None, env=None): |
82 self.logger = logger |
83 self.logger = logger |
83 if not isinstance(Command, list): |
84 if not isinstance(Command, list): |
84 self.Command_str = Command |
85 self.Command_str = Command |
85 self.Command = [] |
86 self.Command = shlex.split(Command) |
86 for i, word in enumerate(Command.replace("'", '"').split('"')): |
87 else: |
87 if i % 2 == 0: |
88 self.Command = Command |
88 word = word.strip() |
|
89 if len(word) > 0: |
|
90 self.Command.extend(word.split()) |
|
91 else: |
|
92 self.Command.append(word) |
|
93 else: |
|
94 self.Command = [x if type(x)==str else x.decode() for x in Command] |
|
95 self.Command_str = subprocess.list2cmdline(self.Command) |
89 self.Command_str = subprocess.list2cmdline(self.Command) |
96 |
90 |
97 fsencoding = sys.getfilesystemencoding() |
91 fsencoding = sys.getfilesystemencoding() |
98 self.output_encoding = output_encoding |
92 self.output_encoding = output_encoding |
99 |
93 |