Ejemplo n.º 1
0
def main(args, argv):
    approot = find_app_root()
    init_app(approot)
    venvdir = get_venvdir(approot)
    pip_path = os.path.join(venvdir, 'bin', 'pip')

    if args.help:
        print "Usage: sheep install ..."
        print
        print "Delegate to `pip install' in the app's virtual environment."
        print "Must run within app directory."
        print
        print "Usage of `pip install' follows."
        print
        return call([pip_path] + argv)

    if not is_pip_compatible(pip_path):
        return "Your app environment needs to upgrade.  Run 'sheep sync' please."

    pip_download_dir = os.path.join(approot, 'pip-download')
    retval = call([pip_path] + argv + ['--save-download', pip_download_dir])
    dump_requirements(approot)
    if os.path.exists(os.path.join(approot, '.svn')):
        call(['svn', 'add', '-q', pip_download_dir] + \
             glob(os.path.join(pip_download_dir, '*')))
    elif os.path.exists(os.path.join(approot, '.hg')):
        call(['hg', 'add', pip_download_dir])
    return retval
Ejemplo n.º 2
0
def main(args):
    approot = os.path.abspath(args.approot or find_app_root())
    init_app(approot)
    return run_server(approot, args.port, args.pidfile, args.daemon)