Browse Source

remove old function that was used when results were on a separate page

master
wes 8 years ago
parent
commit
decc34bf6e
  1. 2
      Makefile
  2. 12
      src/search.py

2
Makefile

@ -10,7 +10,7 @@ default:
cp -r ./src/styles/* ./build/styles/;
node-sass ./build/styles/search.scss > ./build/styles/search.min.css;
cp -r ./src/templates/search.html ./build/templates/;
cp -r ./src/{archive.py,openlibrary.py,predictions.py,search.py,website.py,textbookExceptions.py} ./build/;
cp -r ./src/{archive.py,openlibrary.py,search.py,website.py,textbookExceptions.py} ./build/;
cp ./src/appconfig ./build/;
sed -i s,NAME_HERE,"$(SRV_NAME)",g ./build/appconfig;
sed -i s,ROOT_HERE,"$(SRV_PREFIX)",g ./build/appconfig;

12
src/search.py

@ -38,15 +38,6 @@ def classToJSON(clss):
"books" : list(clss.books) if clss.books else []
}
def truncate(docid):
"""
Truncate a document id to 12 digits
The document ID should be based on a
hash of unique identifiers
"""
return int(str(docid)[0:12])
def hashsec(course):
"""
Hash a course into a usable id
@ -187,9 +178,6 @@ def search_courses(terms):
]
results = []
for obj, secs in filtered:
# Add the truncated course id
# This is used to point to the resource page for that course
secs["id"] = truncate(obj.meta.id)
secs["title"] = obj.title
if obj["dept"] not in secs["title"]:
secs["dept"] = obj.dept

Loading…
Cancel
Save