This commit is contained in:
Jamie Hardt
2024-07-01 21:04:50 -07:00
parent 12ad66e327
commit 35480978e4
4 changed files with 55 additions and 62 deletions

View File

@@ -17,6 +17,7 @@ from mfbatch.commands import BatchfileParser
from tqdm import tqdm
# import readline
def execute_batch_list(batch_list_path: str, dry_run: bool, interactive: bool):
with open(batch_list_path, mode='r') as f:
parser = BatchfileParser()
@@ -127,5 +128,3 @@ def main():
if __name__ == "__main__":
main()

View File

@@ -21,6 +21,7 @@ class UnrecognizedCommandError(Exception):
self.command = command
self.line = line
class CommandArgumentError(Exception):
command: str
line: int
@@ -110,7 +111,6 @@ they appear in the batchfile.
COMMAND_LEADER = ':'
COMMENT_LEADER = '#'
def __init__(self):
self.dry_run = True
self.env = CommandEnv()
@@ -125,7 +125,7 @@ they appear in the batchfile.
def _handle_command(self, line, lineno):
args = shlex.split(line)
actions = [member for member in dir(self) \
actions = [member for member in dir(self)
if not member.startswith('_')]
if args[0] in actions:
@@ -158,7 +158,7 @@ they appear in the batchfile.
value = self.env.metadatums[key]
LINE_LEN = int(shutil.get_terminal_size()[0]) - 32
value_lines = [value[i:i+LINE_LEN] for i in \
value_lines = [value[i:i+LINE_LEN] for i in
range(0, len(value), LINE_LEN)]
for l in value_lines:
@@ -282,7 +282,3 @@ they appear in the batchfile.
"""
val = args[0]
self.env.set_once('DESCRIPTION', val)

View File

@@ -69,4 +69,3 @@ def write_metadata(path: str, data: FlacMetadata,
insert_job = run([metaflac_path, "--import-tags-from=-", path],
input=metadatum_f.encode('utf-8'))
insert_job.check_returncode()

View File

@@ -19,4 +19,3 @@ def readline_with_escaped_newlines(f):
else:
yield line, line_no
line = ''