mirror of
https://github.com/iluvcapra/mfbatch.git
synced 2025-12-31 08:50:51 +00:00
Online doc changes
This commit is contained in:
@@ -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):
|
for line, line_no in readline_with_escaped_newlines(f):
|
||||||
if len(line) > 0:
|
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):
|
def create_batch_list(command_file: str, recursive=True):
|
||||||
@@ -101,7 +101,7 @@ def main():
|
|||||||
if options.help_commands:
|
if options.help_commands:
|
||||||
print("Command Help\n------------")
|
print("Command Help\n------------")
|
||||||
commands = [command for command in dir(BatchfileParser) if
|
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")
|
print(f"{inspect.cleandoc(BatchfileParser.__doc__ or '')}\n\n")
|
||||||
for command in commands:
|
for command in commands:
|
||||||
meth = getattr(BatchfileParser, command)
|
meth = getattr(BatchfileParser, command)
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ they appear in the batchfile.
|
|||||||
self.write_metadata_f = flac
|
self.write_metadata_f = flac
|
||||||
self.outstream = sys.stdout
|
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.
|
Accept a line from the file and act on it.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class BatchfileParserTests(unittest.TestCase):
|
|||||||
def test_set_command(self):
|
def test_set_command(self):
|
||||||
"Test set command"
|
"Test set command"
|
||||||
self.command_parser.set(['X', 'Y'])
|
self.command_parser.set(['X', 'Y'])
|
||||||
self.command_parser._eval("./testfile.flac", lineno=1,
|
self.command_parser.eval("./testfile.flac", lineno=1,
|
||||||
interactive=False)
|
interactive=False)
|
||||||
self.assertTrue(cast(MagicMock,
|
self.assertTrue(cast(MagicMock,
|
||||||
self.command_parser.write_metadata_f).called)
|
self.command_parser.write_metadata_f).called)
|
||||||
@@ -50,7 +50,7 @@ class BatchfileParserTests(unittest.TestCase):
|
|||||||
"Test setp command"
|
"Test setp command"
|
||||||
self.command_parser.set(['VAL', 'ABC123'])
|
self.command_parser.set(['VAL', 'ABC123'])
|
||||||
self.command_parser.setp(['DONE', 'VAL', r"([A-Z]+)123", r"X\1"])
|
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)
|
interactive=False)
|
||||||
|
|
||||||
self.assertTrue(cast(MagicMock,
|
self.assertTrue(cast(MagicMock,
|
||||||
@@ -61,5 +61,5 @@ class BatchfileParserTests(unittest.TestCase):
|
|||||||
|
|
||||||
def test_eval(self):
|
def test_eval(self):
|
||||||
"Test eval"
|
"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')
|
self.assertEqual(self.command_parser.env.metadatums['A'], '1')
|
||||||
|
|||||||
Reference in New Issue
Block a user