Did I find the right examples for you? yes no

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)
only format if not a string

        def formatIfNotString(v):
    "only format if not a string"
    if type(v) in types.StringTypes:
        return v
    return format(v, readable=False)
        


src/w/h/whiff-1.1/whiff/middleware/png/pieChartLink.py   whiff(Download)
    def __call__(self, env, start_response):
        #pr "calling pieChartLink"
        labelsAndData = self.param_json(self.labelsAndData, env)
        labelsAndData = jsonParse.formatIfNotString(labelsAndData)
        #pr "formatted ld", labelsAndData
        radius = self.param_json(self.radius, env)
        radius = jsonParse.formatIfNotString(radius)
        for (k,v) in self.other_parameters.items():
            v = self.param_json(v, env)
            fv = jsonParse.formatIfNotString(v)
            params[k] = fv
        #pr "from", self.other_parameters

src/w/h/whiff-1.1/whiff/middleware/png/barChartLink.py   whiff(Download)
    def __call__(self, env, start_response):
        #pr "calling barChartLink"
        labelsAndData = self.param_json(self.labelsAndData, env)
        labelsAndData = jsonParse.formatIfNotString(labelsAndData)
        #pr "formatted ld", labelsAndData
        axisDelta = self.param_json(self.axisDelta, env)
        axisDelta = jsonParse.formatIfNotString(axisDelta)
        for (k,v) in self.other_parameters.items():
            v = self.param_json(v, env)
            fv = jsonParse.formatIfNotString(v)
            params[k] = fv
        #pr "from", self.other_parameters