From fb90b5db3c8f161c943e0cdf86f42cb8d20cbdb0 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Tue, 15 Oct 2024 11:33:21 -0700 Subject: [PATCH] Online doc changes --- mfbatch/__main__.py | 4 ++-- mfbatch/commands.py | 2 +- tests/__init__.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mfbatch/__main__.py b/mfbatch/__main__.py index 104b9bb..2a02bda 100644 --- a/mfbatch/__main__.py +++ b/mfbatch/__main__.py @@ -26,7 +26,7 @@ def execute_batch_list(batch_list_path: str, dry_run: bool, interactive: bool): for line, line_no in readline_with_escaped_newlines(f): if len(line) > 0: - parser._eval(line, line_no, interactive) + parser.eval(line, line_no, interactive) def create_batch_list(command_file: str, recursive=True): @@ -101,7 +101,7 @@ def main(): if options.help_commands: print("Command Help\n------------") commands = [command for command in dir(BatchfileParser) if - not command.startswith('_')] + not command.startswith('_') or command is not "eval"] print(f"{inspect.cleandoc(BatchfileParser.__doc__ or '')}\n\n") for command in commands: meth = getattr(BatchfileParser, command) diff --git a/mfbatch/commands.py b/mfbatch/commands.py index ce58d3a..85cd982 100644 --- a/mfbatch/commands.py +++ b/mfbatch/commands.py @@ -164,7 +164,7 @@ they appear in the batchfile. self.write_metadata_f = flac self.outstream = sys.stdout - def _eval(self, line: str, lineno: int, interactive: bool): + def eval(self, line: str, lineno: int, interactive: bool): """ Accept a line from the file and act on it. """ diff --git a/tests/__init__.py b/tests/__init__.py index edfb7e6..b4cf60f 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -31,7 +31,7 @@ class BatchfileParserTests(unittest.TestCase): def test_set_command(self): "Test set command" self.command_parser.set(['X', 'Y']) - self.command_parser._eval("./testfile.flac", lineno=1, + self.command_parser.eval("./testfile.flac", lineno=1, interactive=False) self.assertTrue(cast(MagicMock, self.command_parser.write_metadata_f).called) @@ -50,7 +50,7 @@ class BatchfileParserTests(unittest.TestCase): "Test setp command" self.command_parser.set(['VAL', 'ABC123']) self.command_parser.setp(['DONE', 'VAL', r"([A-Z]+)123", r"X\1"]) - self.command_parser._eval("./testfile.flac", lineno=1, + self.command_parser.eval("./testfile.flac", lineno=1, interactive=False) self.assertTrue(cast(MagicMock, @@ -61,5 +61,5 @@ class BatchfileParserTests(unittest.TestCase): def test_eval(self): "Test eval" - self.command_parser._eval(":set A 1", 1, False) + self.command_parser.eval(":set A 1", 1, False) self.assertEqual(self.command_parser.env.metadatums['A'], '1')