def run(self, command): with Dir.cd(self.working_dir): self.process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=self.path, shell=True, preexec_fn=self._preexec_val()) self.pid = self.process.pid self.last_command = command.rstrip() ProcessCache.add(self) return self
def load_process_cache(): for process in ProcessCache.get_from_storage(): ProcessCache.add( CrossPlatformProcess(process['workding_dir'], process['last_command'], process['pid']) )
def load_process_cache(): for process in ProcessCache.get_from_storage(): ProcessCache.add( CrossPlatformProcess(process['workding_dir'], process['last_command'], process['pid']))