-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* port to python3 (#4) * initial 2to3 run * remove supervisor from required (not python3 compatible yet) * format to PEP8 spec * fix location of views/services imports; fix encoding issues * pasteurized * remove imports not yet installed via install_requires * require future * bump version
- Loading branch information
Showing
22 changed files
with
574 additions
and
299 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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
#!/usr/bin/env python | ||
from __future__ import unicode_literals | ||
from __future__ import print_function | ||
from __future__ import division | ||
from __future__ import absolute_import | ||
from future import standard_library | ||
standard_library.install_aliases() | ||
from tosca import db | ||
db.create_all() |
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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
from __future__ import unicode_literals | ||
from __future__ import print_function | ||
from __future__ import division | ||
from __future__ import absolute_import | ||
from future import standard_library | ||
standard_library.install_aliases() | ||
from tosca import app | ||
|
||
|
||
if __name__ == '__main__': | ||
context = ('server.pem', 'server.key') | ||
app.run(host="0.0.0.0", port=8879, debug=True, ssl_context=context) | ||
app.run(host="0.0.0.0", port=8879, debug=True) |
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
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 |
---|---|---|
@@ -1,16 +1,27 @@ | ||
#!/usr/bin/env python | ||
from __future__ import unicode_literals | ||
from __future__ import print_function | ||
from __future__ import division | ||
from __future__ import absolute_import | ||
from future import standard_library | ||
standard_library.install_aliases() | ||
from requests.exceptions import HTTPError | ||
|
||
from tosca import app | ||
from tosca.services.user_rules import create_user_rules_index, add_grq_mappings | ||
|
||
try: | ||
create_user_rules_index(app.config['ES_URL'], app.config['USER_RULES_INDEX']) | ||
create_user_rules_index( | ||
app.config['ES_URL'], app.config['USER_RULES_INDEX']) | ||
except HTTPError as e: | ||
if e.response.status_code == 400: pass | ||
else: raise | ||
if e.response.status_code == 400: | ||
pass | ||
else: | ||
raise | ||
try: | ||
add_grq_mappings(app.config['ES_URL'], app.config['USER_RULES_INDEX']) | ||
except HTTPError as e: | ||
if e.response.status_code == 404: pass | ||
else: raise | ||
if e.response.status_code == 404: | ||
pass | ||
else: | ||
raise |
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 |
---|---|---|
@@ -1,13 +1,18 @@ | ||
from __future__ import unicode_literals | ||
from __future__ import print_function | ||
from __future__ import division | ||
from __future__ import absolute_import | ||
from setuptools import setup, find_packages | ||
|
||
setup( | ||
name='tosca', | ||
version='0.2.3', | ||
version='0.3.0', | ||
long_description='Advanced FacetView User Interface', | ||
packages=find_packages(), | ||
include_package_data=True, | ||
zip_safe=False, | ||
install_requires=['Flask', 'gunicorn', 'gevent', 'supervisor', 'requests', | ||
install_requires=['Flask', 'gunicorn', 'gevent', 'requests', | ||
'Flask-SQLAlchemy', 'Flask-WTF', 'Flask-DebugToolbar', | ||
'Flask-Login', 'simpleldap', 'simplekml'] | ||
'Flask-Login', 'simpleldap', 'simplekml', | ||
'future>=0.17.1'] | ||
) |
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
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
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 |
---|---|---|
@@ -1,26 +1,39 @@ | ||
import json, os | ||
from __future__ import unicode_literals | ||
from __future__ import print_function | ||
from __future__ import division | ||
from __future__ import absolute_import | ||
from future import standard_library | ||
standard_library.install_aliases() | ||
import json | ||
import os | ||
from tosca import app | ||
|
||
import hysds_commons.request_utils | ||
|
||
def mozart_call(method,data={}): | ||
|
||
def mozart_call(method, data={}): | ||
''' | ||
Call mozart method with data | ||
@param method - method to call | ||
@param data - data to supply to call | ||
''' | ||
url = os.path.join(app.config['GRQ_URL'],"api/v0.1",method) | ||
url = os.path.join(app.config['GRQ_URL'], "api/v0.1", method) | ||
getpost = "GET" | ||
res = hysds.lib.request_utils.requests_json_response(getpost,url,data=data,verify=False,logger=app.logger) | ||
res = hysds.lib.request_utils.requests_json_response( | ||
getpost, url, data=data, verify=False, logger=app.logger) | ||
return res["result"] | ||
|
||
|
||
def get_hysds_io_list(): | ||
''' | ||
Queries GRQ to get HySDS IOs | ||
''' | ||
return mozart_call("hysds_io/list") | ||
|
||
|
||
def get_hysds_io(ident): | ||
''' | ||
Queries GRQ to get HySDS Metadata object | ||
@param ident - identity to get | ||
''' | ||
return mozart_call("hysds_io/type",{"id":ident}) | ||
return mozart_call("hysds_io/type", {"id": ident}) |
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
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
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
Oops, something went wrong.