def install_application(): VirtualenvManager.run_with(['--install-apt', '--no-checks']) VirtualenvManager.run_with(['--install-opencv', '--no-checks']) VirtualenvManager.run_with(['--install-libs', '--no-checks']) install_self()
run(['sudo', 'apt-get', 'install', dep.strip(), '-y']) except Exception as e: log.exit_nicely('fail running apt-get install dependencies.apt', e) def run_app_debug(): run([get_python_path('venv'), 'app.py', 'DEBUG']) def run_app(): run_app_debug() # TODO: run with gunicorn def process_params(): manager = ExecutionManager() manager.add('--install', install_application, 'installs the aplication.') manager.add('--install-apt', install_apt, 'install required softwares') manager.add('--install-opencv', install_opencv, 'downloads, compiles and install opencv with ffmpeg support.') manager.add('--install-libs', install_libs, 'installs libraries') manager.add('--install-devlibs', install_devlibs, 'installs development libraries') manager.add('--run', run_app, 'runs the aplication production') manager.add('--run-dev', run_app_debug, 'runs the aplication development') manager.process() if __name__ == '__main__': venv_man = VirtualenvManager() check_ambient() if venv_man.enter(): process_params()