From ee1dd32a055275620d1837bef51b50c25faf0a70 Mon Sep 17 00:00:00 2001 From: tmitche2 Date: Thu, 5 Mar 2020 16:24:10 -0500 Subject: [PATCH] Saving before checking out branch --- cce_search/search.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cce_search/search.py b/cce_search/search.py index f8a32a3..6fed851 100644 --- a/cce_search/search.py +++ b/cce_search/search.py @@ -60,20 +60,21 @@ def index(): def proc_results(r): + print("PRINTING ALL PROC_RESULTS") + print(r) return [enhance_results(res) for res in r['data']['results']] def enhance_results(r): if r.get('title') == 'renewal': return r - - """ return {**r, **{'original': strip_tags(r.get('xml')), + print("PRINTING REGISTRATIONS NOW") + print(r.get('registrations')) + return {**r, **{'original': strip_tags(r.get('xml')), 'is_post_1963': is_post_1963(r.get('registrations')), 'is_foreign': is_foreign(r.get('registrations')), 'is_interim': is_interim(r.get('registrations')), - 'source_url': ia_url(r.get('source', {}))}} """ - - return r + 'source_url': ia_url(r.get('source', {}))}} def strip_tags(xml): @@ -82,7 +83,7 @@ def strip_tags(xml): return "" -def ia_url(src): +def ia_url(src): #return src return "{}#page/{:d}/mode/1up".format(ia_stream(src.get('url', '')), src.get('page', 0)) @@ -92,6 +93,8 @@ def ia_stream(url): def is_post_1963(regs): + print("PRINTING REGS NOW") + print(regs) return any([r['date'] > '1963' for r in regs])