def remove(self): '''Removes a Jterator project.''' # remove_pipe_file(self.location, self.pipe['name']) # remove_handles_folder(self.location) if not os.path.exists(self.location): raise PipelineOSError('Project does not exist: %s' % self.location) shutil.rmtree(self.location)
def save(self): '''Saves a Jterator project: Updates the content of *pipeline* and *handles* files on disk according to modifications to the pipeline and module descriptions. ''' if not os.path.exists(self.location): raise PipelineOSError('Project does not exist: %s' % self.location) self._update_pipe() self._update_handles()
def _get_pipe_file(self, directory=None): if not directory: directory = self.location pipe_files = glob.glob(os.path.join(directory, self._pipe_filename)) if len(pipe_files) == 1: return pipe_files[0] elif len(pipe_files) > 1: raise PipelineOSError( 'More than one pipeline descriptor file found: %s' % directory) else: return self.pipe_file