File: __init__.py

package info (click to toggle)
paste 3.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,472 kB
  • sloc: python: 19,960; javascript: 8,028; makefile: 47; sh: 24
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