summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/hosting/server/ratings.py
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2013-01-03 08:10:25 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2013-01-03 08:10:25 +0000
commit2853156a2bce535bcaa440c37cf872916f76c03b (patch)
tree8e161033a9bac8274dcaca05940964b91cdb2bfc /sca-cpp/trunk/hosting/server/ratings.py
parent55607ea78e10832838d52fdb17cbdfe4355c3265 (diff)
Refactoring, rename isNil to isNull.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1428206 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/hosting/server/ratings.py')
-rw-r--r--sca-cpp/trunk/hosting/server/ratings.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/sca-cpp/trunk/hosting/server/ratings.py b/sca-cpp/trunk/hosting/server/ratings.py
index 5638d8609f..d36dcad45e 100644
--- a/sca-cpp/trunk/hosting/server/ratings.py
+++ b/sca-cpp/trunk/hosting/server/ratings.py
@@ -31,7 +31,7 @@ def put(id, ratings, user, cache, db, apps):
# Get the requested app
app = apps.get(id)
- if isNil(app):
+ if isNull(app):
debug('ratings.py::put', 'app not found', id)
return False
@@ -52,7 +52,7 @@ def patch(id, ratings, user, cache, db, apps):
# Get the requested app
app = apps.get(id)
- if isNil(app):
+ if isNull(app):
debug('ratings.py::patch', 'app not found', id)
return False
@@ -107,9 +107,9 @@ def get(id, user, cache, db, apps):
debug('ratings.py::get::id', id)
# Return the top ratings
- if isNil(id):
+ if isNull(id):
topentries = db.get((("'regex", '("ratings" .* "app.ratings")'), ("'rank", "(regexp_matches(value, '(.*\(rating )([^\)]+)(\).*)'))[2]::float"), ("'limit", 25)))
- flatentries = tuple(map(lambda v: car(v), () if isNil(topentries) else topentries))
+ flatentries = tuple(map(lambda v: car(v), () if isNull(topentries) else topentries))
def rating(e):
return cadr(assoc("'rating", assoc("'ratings", assoc("'content", e))))
sortedentries = tuple(sorted(flatentries, key = rating, reverse = True))
@@ -119,7 +119,7 @@ def get(id, user, cache, db, apps):
# Get the requested app
app = apps.get(id)
- if isNil(app):
+ if isNull(app):
debug('ratings.py::get', 'app not found', id)
# Return default ratings
@@ -127,7 +127,7 @@ def get(id, user, cache, db, apps):
# Get the requested ratings
ratings = cache.get(ratingsid(id))
- if isNil(ratings):
+ if isNull(ratings):
debug('ratings.py::get', 'ratings not found', id)
# Return default ratings
@@ -144,7 +144,7 @@ def delete(id, user, cache, db, apps):
# Get the requested app
app = apps.get(id)
- if isNil(app):
+ if isNull(app):
debug('ratings.py::delete', 'app not found', id)
return False