Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
''' | ||
distill: This package contains a flask app RESTful api for distill | ||
This flask app exposes some restful api endpoints for querying User-ALE. | ||
Very similar to Lucene syntax for basic query operations. | ||
Copyright 2016, The Charles Stark Draper Laboratory | ||
Licensed under Apache Software License. | ||
''' | ||
|
||
from distill.exceptions import ValidationError | ||
import json, yaml | ||
|
||
# doc = yaml.safe_load (msg) | ||
# return json.dumps (doc, indent=4, separators=(',', ': '), sort_keys=True) | ||
|
||
|
||
""" | ||
Raises ValidationError | ||
""" | ||
def validate_request (q): | ||
if 'q' not in q: | ||
raise ValidationError ("Missing required parameter: %s" % 'q') | ||
else: | ||
# Handle rest of parsing | ||
pass | ||
|
||
def str2bool(v): | ||
return v.lower() in ("yes", "true", "t", "1") |