def main(): root = sys.argv[1] if len(sys.argv) > 2: destdir = sys.argv[2] else: destdir = None update(core.pkgset(root), destdir, True)
def configure(root=None, redirect_to_fallback=True, fallback_url=None): from pypiserver.core import pkgset global packages if root is None: root = os.path.expanduser("~/packages") if fallback_url is None: fallback_url="http://pypi.python.org/simple" packages = pkgset(root) config.redirect_to_fallback = redirect_to_fallback config.fallback_url = fallback_url
def configure(root=None, redirect_to_fallback=True, fallback_url=None, password_file=None): from pypiserver.core import pkgset global packages if root is None: root = os.path.expanduser("~/packages") if fallback_url is None: fallback_url = "http://pypi.python.org/simple" packages = pkgset(root) config.redirect_to_fallback = redirect_to_fallback config.fallback_url = fallback_url if password_file: from passlib.apache import HtpasswdFile config.htpasswdfile = HtpasswdFile(password_file)