MCPcopy Create free account
hub / github.com/NUKnightLab/StoryMapJS / inject_index_data

Function inject_index_data

storymap/api.py:126–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124
125@app.context_processor
126def inject_index_data():
127 examples = json.load(open(examples_json))
128 # note this appears elsewhere and should probably be done once
129 # but I'm feeling lazy right now
130 static_url = settings.STATIC_URL or app.static_url_path
131 for e in examples:
132 for key in ["link","thumbnail","source_logo"]:
133 if not e[key].startswith('http'):
134 e[key] = urljoin(static_url,e[key])
135
136 return dict(examples=examples,faqs=json.load(open(faq_json)))
137
138class APIEncoder(json.JSONEncoder):
139 def default(self, obj):

Callers

nothing calls this directly

Calls 2

urljoinFunction · 0.85
loadMethod · 0.80

Tested by

no test coverage detected