def install_requirements(use_sudo=False, exists_action='i'): "Install the required packages from the requirements file using pip" func = use_sudo and sudo or run with venv(): with in_project(): func( "pip install -r requirements.txt --exists-action=%s" % exists_action)
def install_lib(lib_name, use_sudo=False): """ Install lib with given name """ func = use_sudo and sudo or run with venv(): with in_project(): func("pip install %s" % lib_name)
def django_env(command, use_sudo=False): """ run command in django environment """ func = use_sudo and sudo or run with venv(): with in_project(): func(command)
def main(argv): """Merge include files into html.""" if argv and \ len(argv) == 2: infile = argv[0] outfile = argv[1] try: write_output(infile, outfile) except: import traceback traceback.print_exc() print('Unexpected error while merging %s' % infile) else: print('usage: python merge-includes.py <infile> <outfile>') if __name__ == "__main__": from virtualenv import venv with venv(django_app='goodcrypto'): main(sys.argv[1:])