Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def start_honcho(processes, env=None):
manager = honcho.manager.Manager()
for p in honcho.environ.expand_processes(processes, env=env):
e = os.environ.copy()
e.update(p.env)
manager.add_process(p.name, p.cmd, env=e)
manager.loop()
sys.exit(manager.returncode)
if args.processes:
processes = compat.OrderedDict()
for name in args.processes:
try:
processes[name] = procfile.processes[name]
except KeyError:
raise CommandError("Process type '{0}' does not exist in Procfile".format(name))
else:
processes = procfile.processes
manager = Manager(Printer(sys.stdout,
colour=(not args.no_colour),
prefix=(not args.no_prefix)))
for p in environ.expand_processes(processes,
concurrency=concurrency,
env=env,
quiet=quiet,
port=port):
e = os.environ.copy()
e.update(p.env)
manager.add_process(p.name, p.cmd, quiet=p.quiet, env=e)
manager.loop()
sys.exit(manager.returncode)
def command_export(args):
if args.log == "/var/log/APP":
args.log = args.log.replace('APP', args.app)
procfile_path = _procfile_path(args.app_root, _choose_procfile(args))
procfile = _procfile(procfile_path)
env = _read_env(args.app_root, args.env)
concurrency = _parse_concurrency(args.concurrency)
port = _choose_port(args, env)
processes = environ.expand_processes(procfile.processes,
concurrency=concurrency,
env=env,
port=port)
export_ctor = export_choices[args.format].load()
export = export_ctor(template_dir=args.template_dir)
context = {
'app': args.app,
'app_root': os.path.abspath(args.app_root),
'log': args.log,
'shell': args.shell,
'user': args.user or args.app,
}
_mkdir(args.location)