def export(self): self.load_project() self.create_dir() logging.info("Export") from export import generate if generate(self.name, self.data, self.format, self.directory): self.update_task(self.task['name'], "export") logging.info("Export done!") return sys.exit() else: self.update_task(self.task['name'], "export", False) return sys.exit("Failed to export")
def export(self): self.load_project() self.create_dir() logging.info("Export") from export import generate if generate(self.name, self.data, self.format, self.directory): try: self.update_status(self.task['name'], "export") except pymongo.errors.OperationFailure: pass logging.info("Export done!") return sys.exit() else: try: self.update_status(self.task['name'], "export", False) except pymongo.errors.OperationFailure: pass return sys.exit("Failed to export")