API Documentation¶
- class honcho.process.Process(cmd, name=None, colour=None, quiet=False, env=None, cwd=None)[source]¶
Bases:
object
A simple utility wrapper around a subprocess.Popen that stores a number of attributes needed by Honcho and supports forwarding process lifecycle events and output to a queue.
- class honcho.environ.ProcessParams(name, cmd, quiet, env)¶
Bases:
tuple
- cmd¶
Alias for field number 1
- env¶
Alias for field number 3
- name¶
Alias for field number 0
- quiet¶
Alias for field number 2
- honcho.environ.expand_processes(processes, concurrency=None, env=None, quiet=None, port=None)[source]¶
Get a list of the processes that need to be started given the specified list of process types, concurrency, environment, quietness, and base port number.
Returns a list of ProcessParams objects, which have name, cmd, env, and quiet attributes, corresponding to the parameters to the constructor of honcho.process.Process.
- honcho.environ.parse(content)[source]¶
Parse the content of a .env file (a line-delimited KEY=value format) into a dictionary mapping keys to values.
- class honcho.manager.Manager(printer=None)[source]¶
Bases:
object
Manager is responsible for running multiple external processes in parallel managing the events that result (starting, stopping, printing). By default it relays printed lines to a printer that prints to STDOUT.
Example:
import sys from honcho.manager import Manager m = Manager() m.add_process('server', 'ruby server.rb') m.add_process('worker', 'python worker.py') m.loop() sys.exit(m.returncode)
- add_process(name, cmd, quiet=False, env=None, cwd=None)[source]¶
Add a process to this manager instance. The process will not be started until
loop()
is called.
- loop()[source]¶
Start all the added processes and multiplex their output onto the bound printer (which by default will print to STDOUT).
If one process terminates, all the others will be terminated by Honcho, and
loop()
will return.This method will block until all the processes have terminated.
- class honcho.export.base.BaseExport(template_dir=None, template_env=None)[source]¶
Bases:
object
- class honcho.export.supervisord.Export(template_dir=None, template_env=None)[source]¶
Bases:
BaseExport