web/blinkster/handler.py
author ymh <ymh.work@gmail.com>
Thu, 05 Aug 2010 17:25:14 +0200
changeset 49 92e78a11e8df
parent 36 bbe6f42d42b2
child 68 b40657713336
permissions -rw-r--r--
small changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36
bbe6f42d42b2 correct create virtualenv script
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
49
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
     2
activate_this = '/Users/ymh/dev/workspace/blinkster/sbin/bvenv/bin/activate_this.py'
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
     3
execfile(activate_this, dict(__file__=activate_this))
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
     4
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
     5
#ALLDIRS = ['/Users/ymh/dev/workspace/blinkster/sbin/bvenv/lib/python2.5/site-packages']
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
     6
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
     7
##import sys 
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
     8
#import site 
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
     9
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    10
#prev_sys_path = list(sys.path) 
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    11
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    12
# Add each new site-packages directory.
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    13
#for directory in ALLDIRS:
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    14
#    site.addsitedir(directory)
36
bbe6f42d42b2 correct create virtualenv script
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
49
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    16
# Reorder sys.path so new directories at the front.
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    17
#new_sys_path = [] 
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    18
#for item in list(sys.path): 
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    19
#    if item not in prev_sys_path: 
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    20
#        new_sys_path.append(item) 
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    21
#        sys.path.remove(item) 
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    22
#sys.path[:0] = new_sys_path 
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    23
36
bbe6f42d42b2 correct create virtualenv script
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
49
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    25
#import django.core.handlers.modpython
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    26
from django.core.handlers.modpython import handler
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    27
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    28
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    29
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    30
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    31
#def handler(req):
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    32
#    activate_this = req.get_options().get("virtualenv.activate_path")
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    33
#    execfile(activate_this, dict(__file__=activate_this))
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    34
    # Remember original sys.path.
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    35
92e78a11e8df small changes
ymh <ymh.work@gmail.com>
parents: 36
diff changeset
    36
#    return django.core.handlers.modpython.handler(req)