ly.cli package¶
Module contents¶
The commandline interface of the ‘ly’ command.
Submodules¶
ly.cli.command module¶
The commands that are available to the command line.
- class ly.cli.command.abs2rel[source]¶
Bases:
ly.cli.command._edit_command
convert absolute music to relative
- class ly.cli.command.highlight(output=None)[source]¶
Bases:
ly.cli.command._export_command
write syntax colored HTML.
- ly.cli.command.hl¶
alias of
ly.cli.command.highlight
- class ly.cli.command.reformat[source]¶
Bases:
ly.cli.command.indent
reformat the document
- class ly.cli.command.rel2abs[source]¶
Bases:
ly.cli.command._edit_command
convert relative music to absolute
- class ly.cli.command.set_variable(arg)[source]¶
Bases:
ly.cli.command._command
set a variable to a value
- class ly.cli.command.simplify_accidentals[source]¶
Bases:
ly.cli.command._edit_command
replace notes with accidentals as much as possible with their natural neighbors
- class ly.cli.command.translate(language)[source]¶
Bases:
ly.cli.command._edit_command
translate pitch names
ly.cli.main module¶
The entry point for the ‘ly’ command.
- class ly.cli.main.Output[source]¶
Bases:
object
Object living for a whole file/command operation, handling the output.
When opening a file it has already opened earlier, the file is appended to (like awk).
- file(opts, filename, encoding)[source]¶
Return a context manager for writing to.
If you set encoding to “binary” or False, the file is opened in binary mode and you should encode the data you write yourself.
- get_filename(opts, filename)[source]¶
Queries the output attribute from the Options and returns it.
If replace_pattern is True (by default) and the attribute contains a ‘*’, it is replaced with the full path of the specified filename, but without extension. It the attribute contains a ‘?’, it is replaced with the filename without path and extension.
If ‘-’ is returned, it denotes standard output.
- ly.cli.main.parse_command(arg)[source]¶
Parse the command string, returning a list of command.command instances.
Exits when a command is invalid.
- ly.cli.main.parse_command_line()[source]¶
Return a three-tuple(options, commands, files).
options is an Options instance with all the command-line options commands is a list of command.command instances files is the list of filename arguments
Also performs error handling and may exit on certain circumstances.