INNER CODE UNIT · Python
parse_options
python-bonobo/bonobo · bonobo/commands/run.py:20
def parse_options(self, *, quiet=False, verbose=False, install=False, **options):
from bonobo import settings
settings.QUIET.set_if_true(quiet)
settings.DEBUG.set_if_true(verbose)
self.install = install
return options
def _run_path(self, file):
# add install logic
if self.install:
if os.path.isdir(file):
requirements = os.path.join(file, "requirements.txt")
else:
requirements = os.path.join(os.path.dirname(file), "requirements.txt")
_install_requirements(requirements)
return super()._run_path(file)