diff options
Diffstat (limited to 'qtip')
-rw-r--r-- | qtip/api/__main__.py | 11 | ||||
-rw-r--r-- | qtip/api/controllers/__init__.py | 0 | ||||
-rw-r--r-- | qtip/api/swagger/swagger.yaml | 9 | ||||
-rw-r--r-- | qtip/collector/parser/grep.py | 4 |
4 files changed, 22 insertions, 2 deletions
diff --git a/qtip/api/__main__.py b/qtip/api/__main__.py new file mode 100644 index 00000000..89298e6d --- /dev/null +++ b/qtip/api/__main__.py @@ -0,0 +1,11 @@ +import connexion + + +def main(): + app = connexion.App(__name__, specification_dir='swagger/') + app.add_api('swagger.yaml', base_path='/v1.0') + app.run(host='0.0.0.0', port='5000') + + +if __name__ == '__main__': + main() diff --git a/qtip/api/controllers/__init__.py b/qtip/api/controllers/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/qtip/api/controllers/__init__.py diff --git a/qtip/api/swagger/swagger.yaml b/qtip/api/swagger/swagger.yaml new file mode 100644 index 00000000..97a9c352 --- /dev/null +++ b/qtip/api/swagger/swagger.yaml @@ -0,0 +1,9 @@ +swagger: '2.0' +info: + title: QTIP-API +consumes: + - application/json +produces: + - application/json +paths: + #TODO (akhil) add paths
\ No newline at end of file diff --git a/qtip/collector/parser/grep.py b/qtip/collector/parser/grep.py index c3274bc2..f74ce403 100644 --- a/qtip/collector/parser/grep.py +++ b/qtip/collector/parser/grep.py @@ -29,6 +29,6 @@ class GrepParser(BaseActor): def grep_in_file(filename, regex): - with open(filename, "r") as outfile: + with open(filename, 'r') as f: return filter(lambda x: x is not None, - list(re.finditer(regex, outfile.read(), re.MULTILINE))) + re.finditer(regex, f.read(), re.MULTILINE)) |