Did I find the right examples for you? yes no

All Samples(29)  |  Call(29)  |  Derive(0)  |  Import(0)

        def getResource(env, resourcePath, default=unusableDefault):
    monitor = getResourceMonitor(env)
    try:
        resource = monitor.get(resourcePath, env)
    except (NoSuchResource,UnknownResource):
        if default is unusableDefault:
            raise
        else:
            return default
    return resource
        


src/w/h/whiff-1.1/whiff/resources/resourceAsDictionary.py   whiff(Download)
    def __getitem__(self, key):
        path = self.keyPath(key)
        env = self.env
        return gateway.getResource(env, path)
    def get(self, key, default=None):
        path = self.keyPath(key)
        env = self.env
        return gateway.getResource(env, path, default)
    def keys(self):
        "Aggregate operations will only work if pathPrefix gives 'directory contents'"
        path = self.pathPrefix
        sequence = gateway.getResource(env, path)
        return list(sequence)

src/w/h/whiff-1.1/whiff/resources/GAETreeStore.py   whiff(Download)
    creatorPath = ["session", "item", "creatorNick"]
    passwordPath = ["session", "item", "password"]
    sesscreator = gateway.getResource(env, creatorPath, "")
    sesspassword = gateway.getResource(env, passwordPath, "")
    #pr "got session password", (sesspassword, envpassword, passwordOk)

src/w/h/whiff-1.1/whiff/middleware/insertIfNeeded.py   whiff(Download)
    def __call__(self, env, start_response):
        doneFlag = self.param_value(self.doneFlag,env)
        donePath = ["local", doneFlag]
        done = gateway.getResource(env, donePath, False)
        if not done:
            needed = True
            if self.needFlag:
                needFlag = self.param_value(self.needFlag, env)
                needPath = ["local", needFlag]
                needed = gateway.getResource(env, needPath, False)

src/w/h/whiff-1.1/whiff/middleware/checkProfile.py   whiff(Download)
            #pr "user from params", user
        if not user and sessionResourcePath:
            user = gateway.getResource(env, sessionResourcePath+[userVariable])
            user = user.strip()
            #pr "user from session", user
            #pr "password from params", password
        if not password and  sessionResourcePath:
            password = gateway.getResource(env, sessionResourcePath+[passwordVariable])
            #pr "password from session", password
        if not password:
    def checkProfile(self, env, profileResourcePrefix, user, password):
        #pr "checking profile", profileResourcePrefix, user, password
        resourcePath = profileResourcePrefix+["id", user]
        #pr "GETTING PATH", resourcePath
        result = gateway.getResource(env, resourcePath, False)

src/w/h/whiff-1.1/whiff/middleware/repoze/who.py   whiff(Download)
    def getResourceFromParam(self, param, env, defaultValue="forbidden"):
        resourcePath = self.param_json(param, env)
        resource = gateway.getResource(env, resourcePath, defaultValue)
        assert resource!=defaultValue or defaultValue!="forbidden", "repoze.who parameter not found in WHIFF resources (no default)"
        return resource

src/w/h/whiff-1.1/whiff/middleware/skimpy.py   whiff(Download)
        # find the resources
        try:
            captcha = gateway.getResource(env, captchaPath)
        except gateway.UnknownResource:
            captcha = None
        try:
            timeout = gateway.getResource(env, timeoutPath)
        timeout = float(timeout)
        try:
            secret = gateway.getResource(env, secretPath)
        except gateway.UnknownResource:
            secret = defaultSecret

src/w/h/whiff-1.1/whiff/middleware/newProfile.py   whiff(Download)
        else:
            # establish a new profile
            identity = gateway.getResource(env, profileResourcePrefix+["new", user, password])
            if identity:
                # record the profile information in the session and environment

src/w/h/whiff-1.1/whiff/middleware/ofc/OpenFlashChart.py   whiff(Download)
        jsonData = jsonParse.format(page, readable=False)
        data = jsonParse.format(jsonData)
        target_div_id = gateway.getResource(env, ["freshName", "OFCdiv"])
        data_function = gateway.getResource(env, ["freshName", "OFCdata"])
        substitutions["additional_javascript"] = additional_javascript

src/w/h/whiff-1.1/whiff/middleware/treeView.py   whiff(Download)
        # manufacture a rootId if not provided
        if not rootId:
            rootId = gateway.getResource(env, ["freshName", "treeViewRootId"])
        #pr "treeView.__call__ (withContainer, infoPath, focusNode, rootId, expandIds, delNode, addNode)=",(withContainer, infoPath, focusNode, rootId, expandIds, delNode, addNode)
        # get the info data structure and wrap it
        else:
            assert infoPath is not None, "no tree data specified.  treeView needs either dictionary or infoPath (but not both)"
            infoDict = gateway.getResource(env, infoPath)
        info = WrapInfo(infoDict)
        # convert the expandIds to a dictionary

src/w/h/whiff-1.1/whiff/middleware/menuFromList.py   whiff(Download)
    def __call__(self, env, start_response):
        height = self.param_value(self.height, env)
        menuList = self.param_json(self.page, env)
        focusFunction = gateway.getResource(env, ["freshName", "menuFocusFunction"])
        idList = []
        L.append('<ul %s style="padding:0; margin:0; list-style:none;">\n' % classInfo)
        for categoryD in menuList:
            categoryId = gateway.getResource(env, ["freshName", "categoryId"])
            idList.append(categoryId)
            # top category element start

  1 | 2  Next