diff --git a/desidulate/sidinfo2dumpcmd.py b/desidulate/sidinfo2dumpcmd.py index d623d1d..19fba61 100755 --- a/desidulate/sidinfo2dumpcmd.py +++ b/desidulate/sidinfo2dumpcmd.py @@ -5,13 +5,13 @@ from pyresidfp import SoundInterfaceDevice from desidulate.fileio import read_csv -VICEIMAGE = 'anarkiwi/headlessvice' +VICEIMAGE = "anarkiwi/headlessvice:v1.0.0" def main(): parser = argparse.ArgumentParser() - parser.add_argument('sidinfo', type=str) - parser.add_argument('--hvscdir', default='/local/hvsc', type=str) + parser.add_argument("sidinfo", type=str) + parser.add_argument("--hvscdir", default="/local/hvsc", type=str) args = parser.parse_args() df = read_csv(args.sidinfo) @@ -26,21 +26,35 @@ def main(): cycles = int(clock_freq * (row.length + 1)) dname = os.path.join(args.hvscdir, os.path.dirname(path)) bname = os.path.basename(path) - dbname = '%s/%u/%s' % (bname, row.song, bname) - dbname = dbname.replace('.sid', '') - dbname = dbname + '-%u.dump.zst' % row.song + dbname = "%s/%u/%s" % (bname, row.song, bname) + dbname = dbname.replace(".sid", "") + dbname = dbname + "-%u.dump.zst" % row.song dbpath = os.path.join(dname, os.path.dirname(dbname)) vice_cmd = [ - 'docker', 'run', '--rm', '-v', '%s:/vice' % dname, '-i', VICEIMAGE, - 'vsiddump.py', os.path.join('/vice', dbname), - '-warp', '-console', '-silent', - '-limit', str(cycles), - '-tune', str(row.song), - os.path.join('/vice', bname)] + "docker", + "run", + "--rm", + "-v", + "%s:/vice" % dname, + "--name", + path.replace("/", "-") + "-" + str(row.song), + "-i", + VICEIMAGE, + "vsiddump.py", + os.path.join("/vice", dbname), + "-warp", + "-console", + "-silent", + "-limit", + str(cycles), + "-tune", + str(row.song), + os.path.join("/vice", bname), + ] if not os.path.exists(dbpath): os.makedirs(dbpath) - print(' '.join(vice_cmd)) + print(" ".join(vice_cmd)) -if __name__ == '__main__': +if __name__ == "__main__": main()