def _json_lowlevel(location, rotate): print("Creating low-level JSON data dump...") path = dump.dump_lowlevel_json(location) print("Done! Created: %s" % path) if rotate: print("Removing old dumps (except two latest)...") remove_old_archives(location, "acousticbrainz-lowlevel-json-[0-9]+.tar.bz2", is_dir=False, sort_key=lambda x: os.path.getmtime(x))
def _json_lowlevel(location, rotate, threads, sample, files_per_archive): current_app.logger.info("Creating low-level JSON data dump...") path = dump.dump_lowlevel_json(location, threads, sample, num_files_per_archive=files_per_archive) current_app.logger.info("Done! Created: %s", path) if rotate: current_app.logger.info("Removing old dumps (except two latest)...") remove_old_archives(location, "acousticbrainz-lowlevel-json-[0-9]+.tar.zst", is_dir=False, sort_key=lambda x: os.path.getmtime(x))
def _incremental_json_lowlevel(location, id): print("Creating incremental low-level JSON data dump...") path = dump.dump_lowlevel_json(location, incremental=True, dump_id=id) print("Done! Created: %s\n" % path)
def _incremental_json_lowlevel(location, id): current_app.logger.info("Creating incremental low-level JSON data dump...") path = dump.dump_lowlevel_json(location, incremental=True, dump_id=id) current_app.logger.info("Done! Created: %s\n" % path)
def test_dump_lowlevel_json(self): path = dump.dump_lowlevel_json(self.temp_dir) self.assertTrue(os.path.isfile(path))
def test_dump_lowlevel_json(self): path = dump.dump_lowlevel_json(self.temp_dir) for f in os.listdir(path): self.assertTrue(os.path.isfile(os.path.join(path, f)))