Ejemplo n.º 1
0
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))
Ejemplo n.º 2
0
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))
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
 def test_dump_lowlevel_json(self):
     path = dump.dump_lowlevel_json(self.temp_dir)
     self.assertTrue(os.path.isfile(path))
Ejemplo n.º 6
0
 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)))
Ejemplo n.º 8
0
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)