Skip to content
This repository has been archived by the owner on Mar 16, 2019. It is now read-only.

Commit

Permalink
Update preview to handle leveldb
Browse files Browse the repository at this point in the history
  • Loading branch information
jamii committed Mar 17, 2012
1 parent c72691e commit 4eb3d95
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import json

import util
import mr
import db

keys = json.load(open('keys'))

Expand All @@ -20,7 +20,7 @@ def metadata(doi):
conn.close()

if status == 200:
meta = util.encode(json.loads(data)) # !!! metadata encoding?
meta = json.loads(data)
if meta['records']:
return meta
else:
Expand All @@ -41,9 +41,9 @@ def recommendations(build_name, doi):
print title(doi)
print link(doi)
print
dois = mr.get_result(build_name, 'recommendations', doi)
scores = db.SingleValue(build_name, 'scores', 'r').get(doi)
print '-' * 40
for (score, doi) in dois:
for (score, doi) in scores:
print score
print title(doi)
print link(doi)
Expand Down

0 comments on commit 4eb3d95

Please sign in to comment.