def update_data_by_dataset(cls, data_set): fusio_databases_file = utils.new_fusio_files_path(data_set.name) if not os.path.exists(fusio_databases_file): return logging.getLogger(__name__).debug("updating data for {}".format(data_set.name)) #we copy the file to update the reference data shutil.move(fusio_databases_file, os.path.join(utils.instance_data_path(data_set.name), 'fusio/databases.zip'))
def update_data_by_dataset(cls, data_set): fusio_databases_file = utils.new_fusio_files_path(data_set.name) if not os.path.exists(fusio_databases_file): return logging.getLogger(__name__).debug("updating data for {}".format( data_set.name)) #we copy the file to update the reference data shutil.move( fusio_databases_file, os.path.join(utils.instance_data_path(data_set.name), 'fusio/databases.zip'))
def read_data_by_dataset(cls, data_set): logging.getLogger(__name__).debug("reading data for {}".format(data_set.name)) # we'll read all subdir data_path = utils.instance_data_path(data_set.name) data_dirs = [os.path.join(data_path, sub_dir_name) for sub_dir_name in os.listdir(data_path) if os.path.isdir(os.path.join(data_path, sub_dir_name))] logging.getLogger(__name__).debug("loading {}".format(data_dirs)) utils.launch_exec("sudo {tyr} load_data {data_set} {data_set_dir}" .format(tyr=_tyr, data_set=data_set.name, data_set_dir=','.join(data_dirs)), additional_env={'TYR_CONFIG_FILE': _tyr_config_file})
def read_data_by_dataset(cls, data_set): logging.getLogger(__name__).debug("reading data for {}".format( data_set.name)) # we'll read all subdir data_path = utils.instance_data_path(data_set.name) data_dirs = [ os.path.join(data_path, sub_dir_name) for sub_dir_name in os.listdir(data_path) if os.path.isdir(os.path.join(data_path, sub_dir_name)) ] logging.getLogger(__name__).debug("loading {}".format(data_dirs)) utils.launch_exec("{tyr} load_data {data_set} {data_set_dir}".format( tyr=_tyr, data_set=data_set.name, data_set_dir=','.join(data_dirs)), additional_env={'TYR_CONFIG_FILE': _tyr_config_file})