Skip to content

Commit

Permalink
feat(retrieval): add support for recursive scraping, version endpoint
Browse files Browse the repository at this point in the history
Add support for setting the recursive flag in registration to scrape all sub-layers for display in the viewer. Also add support for version endpoint, which returns... the version.

Closes #45
  • Loading branch information
dan-bowerman committed Jul 8, 2016
1 parent ba87df2 commit b2d9e1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 1 addition & 5 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
from __future__ import division, print_function, unicode_literals

import json, jsonschema, config, os, sys, logging, flask, re
import json, jsonschema, config, os, sys, logging, flask
from services import db, v1, v2, utils

from logging.handlers import RotatingFileHandler
Expand Down Expand Up @@ -63,10 +63,6 @@ def log_response(sender, response):
def before_request():
flask.g.get_validator = lambda: jsonschema.validators.Draft4Validator(json.load(open(schema_path)))
flask.g.proxies = {'http': app.config['HTTP_PROXY'], 'https': app.config['HTTP_PROXY']}
with open("setup.py") as f:
for line in f:
if "version" in line:
flask.g.version_no = re.findall("\d+\.\d+.\d+", line)

if app.config.get('DEBUG_ENDPOINTS'):
@app.after_request
Expand Down
8 changes: 6 additions & 2 deletions services/retrieval.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import db, json, flask
import db, json, re

from utils import jsonp
from flask import Response
Expand Down Expand Up @@ -96,4 +96,8 @@ def __init__(self):

class Version(Doc):
def get(self):
return flask.g.version_no
with open("setup.py") as f:
for line in f:
if "version" in line:
version_no = re.findall("\d+\.\d+.\d+", line)
return version_no

0 comments on commit b2d9e1c

Please sign in to comment.