def create_dump_dir(self): """ Checks dump directory exists, creates it if not """ if self._dump_dir is None or len(self._dump_dir) == 0: self._dump_dir = DUMP_DIR dir_ok, self._dump_dir, msg = qtrlio.create_dir(self._dump_dir, desc='dump') if not dir_ok: self.write_to_file = False msg += "\ndump file output will be suppressed." logger.error(msg) return dir_ok
def create_dump_dir(self): """ Checks dump directory exists, creates it if not """ if self._dump_dir is None or len(self._dump_dir) == 0: self._dump_dir = DUMP_DIR dir_ok, self._dump_dir, msg = qtrlio.create_dir( self._dump_dir, desc='dump') if not dir_ok: self.write_to_file = False msg += "\ndump file output will be suppressed." logger.error(msg) return dir_ok
def check_create_output_dir(self, output_dir, desc='output'): """ Checks if the given directory exists, if not it is created Returns ------- dir_ok : boolean True if directory exists (previously or created) False if failed to create the directory output_dir : string Path to the directory, which may be been made absolute msg : string Error msg if directory creation failed """ return qtrlio.create_dir(output_dir, desc=desc)