Did I find the right examples for you? yes no

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

        def formatString(s, mapper=INVQUOTEMAPPING):
    if type(s) is not types.UnicodeType:
        s = unicode(s, 'utf-8', 'ignore')
    L = ['"']
    for c in s:
        mc = mapper.get(c)
        if mc is None:
            L.append(c)
        else:
            L.append(u"\\"+mc)
    L.append('"')
    return "".join(L)
        


src/w/h/whiff-1.1/whiff/middleware/EvalPageFunction.py   whiff(Download)
            rUrl = self.param_value(self.expandRelativeTo,env)
            #pr "eval page setting relative url", repr(rUrl)
            relativeUrl = jsonParse.formatString(rUrl)
            env = expandPostedTemplate.relativeEnvironment(env, rUrl)
        elif env.has_key(whiffenv.TEMPLATE_PATH):
                rUrl = rUrl[1:]
            #pr "eval page function relative url", rUrl
            relativeUrl = jsonParse.formatString(rUrl)
        # package page Content as javascript list format
        linebreak = "\n"
        D = {}
        D["ARRAY"] = jsArray
        D["URL"] = jsonParse.formatString(absoluteUrl)
        D["RELATIVE_URL"] = relativeUrl
        D["PREFIX"] = jsonParse.formatString(prefix)

src/w/h/whiff-1.1/whiff/middleware/misc.py   whiff(Download)
            chunk = line[:maxlen]
            line = line[maxlen:]
            chunkFormatted = jsonParse.formatString(chunk)
            if inside:
                yield ","+chunkFormatted
        if count==nlines:
            # don't add newline
            lineFormatted = jsonParse.formatString(line)
        else:
            # add back newline within formatted string
            lineFormatted = jsonParse.formatString(line+"\n")

src/w/h/whiff-1.1/whiff/middleware/setInnerHtml.py   whiff(Download)
        #pr "page content", repr(pageContent)
        pageContentArray = misc.jsListFromString(pageContent)
        nameString = jsonParse.formatString(name)
        nameString = nameString.strip()
        D = {}