def save_sample(sample_dict, file_yaml): config = load_config() if len(file_yaml.split("/")) >= 2 and os.path.isdir("/".join( file_yaml.split("/")[:-1])) is False: os.mkdir("/".join(file_yaml.split("/")[:-1])) if config["use_mongodb"]: sample_dict = mongo_interface.dump_sample_info(sample_dict) with open(file_yaml, "w") as file_handle: yaml.dump(sample_dict, file_handle)
def save_sample_to_db(sample): return mongo_interface.dump_sample_info(sample)
def save_sample(sample_db): return mongo_interface.dump_sample_info(sample_db)
def post_sample(sample): return mongo_interface.dump_sample_info(sample)
def save(self) -> None: """Saves the in object (dict) to the DB""" self._dict = mongo_interface.dump_sample_info(self._dict)