Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

        def getUserInfo(env, key="repoze.who.userid"):
    try:
        from repoze.who.middleware import Identity
    except ImportError:
        raise ImportError, "repozeWho WHIFF middleware requires repoze.who installation [http://static.repoze.org/whodocs/]"
    identityDict = env.get("repoze.who.identity")
    if identityDict is None:
        return None
    elif not isinstance(identityDict, Identity):
        raise ValueError, "fake identity structure not permitted -- identity must be an instance of repoze.who.middleware.Identity"
    else:
        userid = identityDict.get(key)
        return userid
        


src/w/h/whiff-1.1/whiff/middleware/repoze/onStatus.py   whiff(Download)
 
from whiff.middleware import misc
from uid import getUserInfo
 
class repozeOnStatus(misc.utility):
    def __call__(self, env, start_response):
        uid = getUserInfo(env)
        if uid is None:
            return self.deliver_page(self.unknown, env, start_response)
        else:

src/w/h/whiff-1.1/whiff/middleware/repoze/allow.py   whiff(Download)
 
from whiff.middleware import misc
from uid import getUserInfo
 
class repozeAllow(misc.utility):
    def __call__(self, env, start_response):
        uid = getUserInfo(env)
        users = self.param_json(self.users, env)
        success = False
        if users is None: