Did I find the right examples for you? yes no

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

src/c/y/cyn.in-HEAD/products/ATRatings/RatingsTool.py   cyn.in(Download)
 
# lazy way of configuring this tool
from config import MIN_RATING_VALUE, MAX_RATING_VALUE, STORAGE_CLASS, STORAGE_ARGS, NEUTRAL_RATING_VALUE
from Permissions import ADD_RATING_PERMISSION
from Products.CMFCore.permissions import ManagePortal
                value = repository.get(eachkey,None)
                if value and isinstance(value,int):                    
                    if value == NEUTRAL_RATING_VALUE:
                        self._deleteRating(uid,eachkey)
                    else:
                        returnvalue = returnvalue + (value - NEUTRAL_RATING_VALUE)
                value = repository.get(eachkey,None)
                if value and isinstance(value,int):                    
                    if value > NEUTRAL_RATING_VALUE:
                        result['positive'] = result['positive'] + 1
                        result['positivescore'] = result['positivescore'] + (value - NEUTRAL_RATING_VALUE)