ly.server package¶
Module contents¶
A package implementing an HTTP server to process LilyPond input code.
Submodules¶
ly.server.command module¶
The commands that are available to the command line.
-
class
ly.server.command.
abs2rel
[source]¶ Bases:
ly.server.command._edit_command
convert absolute music to relative
-
class
ly.server.command.
highlight
[source]¶ Bases:
ly.server.command._export_command
convert source to syntax colored HTML.
-
class
ly.server.command.
language
[source]¶ Bases:
ly.server.command._info_command
retrieve language from document
-
class
ly.server.command.
mode
[source]¶ Bases:
ly.server.command._info_command
retrieve mode from document
-
class
ly.server.command.
musicxml
[source]¶ Bases:
ly.server.command._export_command
convert source to MusicXML
-
class
ly.server.command.
reformat
[source]¶ Bases:
ly.server.command.indent
reformat the document
-
class
ly.server.command.
rel2abs
[source]¶ Bases:
ly.server.command._edit_command
convert relative music to absolute
-
class
ly.server.command.
set_variable
(arg)[source]¶ Bases:
ly.server.command._command
set a configuration variable to a value
-
class
ly.server.command.
translate
(language)[source]¶ Bases:
ly.server.command._edit_command
translate pitch names
ly.server.handler module¶
HTTP request handler
-
class
ly.server.handler.
RequestHandler
(request, client_address, server)[source]¶ Bases:
BaseHTTPServer.BaseHTTPRequestHandler
-
create_command
(cmd)[source]¶ Parse one command from the JSON data, plus optionally some commands to set variables. Returns an array with command._command instances. Raises exceptions upon faulty data.
-
do_POST
()[source]¶ A POST request is expected to contain the task to be executed as a JSON object in the request body. The POST handler (currently) ignores the URL.
-
process_json_request
(request)[source]¶ Configure the action(s) to be taken, based on the JSON object. Raise errors when the JSON object can’t be properly understood. Run the commands and return a string (from cursor.text() ).
-
ly.server.main module¶
The entry point for the ‘ly-server’ command.
-
ly.server.main.
die
(message)[source]¶ Exit with message to STDERR. In ly-server this should only be called upon startup, not while processing requests. Then the error should be sent back to the client.
-
ly.server.main.
parse_command_line
()[source]¶ Returns a two-tuple(server_opts, cmd_opts)
server_opts is a ServerOptions instance configuring the server behaviour cmd_opts is an Options instance with default options for future command executions triggered by HTTP requests.
Also performs error handling and may exit on certain circumstances.