Changeset - f24b9a2934cf
[Not reviewed]
default
0 2 0
Marcin Kuzminski - 16 years ago 2010-04-24 18:20:59
marcin@python-works.com
added is mercurial method in utils,
2 files changed with 11 insertions and 4 deletions:
0 comments (0 inline, 0 general)
pylons_app/lib/auth.py
Show inline comments
 
@@ -36,7 +36,6 @@ def admin_auth(username, password):
 
def authfunc(environ, username, password):
 
    sa = meta.Session
 
    password_crypt = get_crypt_password(password)
 
    
 
    try:
 
        user = sa.query(Users).filter(Users.username == username).one()
 
    except (NoResultFound, MultipleResultsFound, OperationalError) as e:
pylons_app/lib/utils.py
Show inline comments
 
   
 
def get_repo_slug(request):
 
    path_info = request.environ.get('PATH_INFO')
 
    uri_lst = path_info.split('/')
 
    print uri_lst
 
    print 'len', len(uri_lst)    
 
    uri_lst = path_info.split('/')   
 
    repo_name = uri_lst[1]
 
    return repo_name
 

	
 
def is_mercurial(environ):
 
    """
 
    Returns True if request's target is mercurial server - header
 
    ``HTTP_ACCEPT`` of such request would start with ``application/mercurial``.
 
    """
 
    http_accept = environ.get('HTTP_ACCEPT')
 
    if http_accept and http_accept.startswith('application/mercurial'):
 
        return True
 
    return False
0 comments (0 inline, 0 general)