forked from github.com/pypiserver
Added authentication by pam and fixed some pep8 complaints
This commit is contained in:
parent
f15a51f894
commit
9a5ff53c6d
@ -91,6 +91,10 @@ def auth_by_htpasswd_file(htPsswdFile, username, password):
|
||||
return htPsswdFile.check_password(username, password)
|
||||
|
||||
|
||||
def auth_by_pam(username, password):
|
||||
import pam
|
||||
return pam.authenticate(username, password)
|
||||
|
||||
|
||||
mimetypes.add_type("application/octet-stream", ".egg")
|
||||
mimetypes.add_type("application/octet-stream", ".whl")
|
||||
@ -246,6 +250,15 @@ def _listdir(root):
|
||||
fn=fn, root=root,
|
||||
relfn=fn[len(root) + 1:])
|
||||
|
||||
try:
|
||||
from .cache import listdir_cache
|
||||
|
||||
def listdir(root):
|
||||
return listdir_cache.get(root, _listdir)
|
||||
except ImportError:
|
||||
listdir = _listdir
|
||||
|
||||
|
||||
def find_packages(pkgs, prefix=""):
|
||||
prefix = normalize_pkgname(prefix)
|
||||
for x in pkgs:
|
||||
|
Loading…
Reference in New Issue
Block a user