示例#1
0
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)
示例#2
0
def save_sample_to_db(sample):
    return mongo_interface.dump_sample_info(sample)
示例#3
0
def save_sample(sample_db):
    return mongo_interface.dump_sample_info(sample_db)
示例#4
0
def post_sample(sample):
    return mongo_interface.dump_sample_info(sample)
示例#5
0
 def save(self) -> None:
     """Saves the in object (dict) to the DB"""
     self._dict = mongo_interface.dump_sample_info(self._dict)