def process_temp_bundle(self, ds_name, path): """ Merge the temp bundle into the main bundle for the specified data source. Parameters ---------- ds_name path Returns ------- """ tmp_bundle = extract_bundle(path) bundle_folder = get_data_source_folder(ds_name) ensure_directory(bundle_folder) if os.listdir(bundle_folder): zsource = bcolz.ctable(rootdir=tmp_bundle, mode='r') ztarget = bcolz.ctable(rootdir=bundle_folder, mode='a') ztarget.append(zsource) else: shutil.rmtree(bundle_folder, ignore_errors=True) os.rename(tmp_bundle, bundle_folder)
def process_temp_bundle(self, ds_name, path): """ Merge the temp bundle into the main bundle for the specified data source. Parameters ---------- ds_name path Returns ------- """ tmp_bundle = extract_bundle(path) bundle_folder = get_data_source_folder(ds_name) ensure_directory(bundle_folder) if os.listdir(bundle_folder): zsource = bcolz.ctable(rootdir=tmp_bundle, mode='r') ztarget = bcolz.ctable(rootdir=bundle_folder, mode='r') merge_bundles(zsource, ztarget) else: os.rename(tmp_bundle, bundle_folder) pass