How to use the honcho.manager.Manager function in honcho

To help you get started, we’ve selected a few honcho examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nickstenning / honcho / tests / View on Github external
def printer(self):  # noqa
        self.p = FakePrinter()
        self.m = Manager(printer=self.p)
        self.m._env = FakeEnv()
github getsentry / sentry / src / sentry / runner / commands / View on Github external
from honcho.manager import Manager
    from honcho.printer import Printer

    os.environ["PYTHONUNBUFFERED"] = "true"

    # Make sure that the environment is prepared before honcho takes over
    # This sets all the appropriate uwsgi env vars, etc
    daemons += [("server", ["sentry", "run", "web"])]

    if styleguide:
        daemons += [("storybook", ["./bin/yarn", "storybook"])]

    cwd = os.path.realpath(os.path.join(settings.PROJECT_ROOT, os.pardir, os.pardir))

    manager = Manager(Printer(prefix=prefix))
    for name, cmd in daemons:
        manager.add_process(name, list2cmdline(cmd), quiet=False, cwd=cwd)

github oTree-org / otree-core / otree / management / commands / View on Github external
def get_honcho_manager(self):

        # this env var is necessary because if the botworker submits a wait page,
        # it needs to broadcast to redis channel layer, not in-memory.
        # this caused an obscure bug on 2019-09-21.
        os.environ['OTREE_USE_REDIS'] = '1'
        env_copy = os.environ.copy()

        manager = HonchoManager()

        # if I change these, I need to modify the ServerCheck also
        manager.add_process('botworker', 'otree botworker', quiet=False, env=env_copy)
            'timeoutworkeronly', 'otree timeoutworkeronly', quiet=False, env=env_copy

        return manager
github django-zero / django-zero / django_zero / commands / utils / View on Github external
def create_honcho_manager(*, printer=None, mode="dev", **kwargs):
    environ = {**os.environ, **kwargs.pop("environ", {}), "PYTHONUNBUFFERED": "1"}

    from honcho.manager import Manager

    m = Manager(printer=printer)

    for proc_name, proc_cmd in sorted(get_procs(mode).items()):
        m.add_process(proc_name, proc_cmd, env=environ)

    return m