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.highlight[source]
Bases:
_export_command
convert source to syntax colored HTML.
- class ly.server.command.set_variable(arg)[source]
Bases:
_command
set a configuration variable to a value
ly.server.handler module
HTTP request handler
- class ly.server.handler.RequestHandler(request, client_address, server)[source]
Bases:
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.
ly.server.options module
Options configuring the commands’ behaviour