File: __init__.py

package info (click to toggle)
paste 2.0.3%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,396 kB
  • ctags: 2,615
  • sloc: python: 18,659; makefile: 17; sh: 7
file content (10 lines) | stat: -rw-r--r-- 289 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
from paste import request

def urlparser_hook(environ):
    first, rest = request.path_info_split(environ.get('PATH_INFO', ''))
    if not first:
        # No username
        return
    environ['app.user'] = first
    environ['SCRIPT_NAME'] += '/' + first
    environ['PATH_INFO'] = rest