diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..d47b168 --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.openstack.org +port=29418 +project=openstack/meteos-ui.git diff --git a/meteos_ui/api/client.py b/meteos_ui/api/client.py index b4d5d24..b10fc18 100644 --- a/meteos_ui/api/client.py +++ b/meteos_ui/api/client.py @@ -14,8 +14,8 @@ from horizon import exceptions from horizon.utils.memoized import memoized import logging -from openstack_dashboard.api import base from meteosclient.api import client as meteos_client +from openstack_dashboard.api import base LOG = logging.getLogger(__name__) @@ -52,9 +52,9 @@ def meteosclient(request): LOG.debug('meteosclient connection created using the token "%s" and url' '"%s"' % (request.user.token.id, meteos_url)) c = meteos_client.Client(username=request.user.username, - project_id=request.user.tenant_id, - input_auth_token=request.user.token.id, - meteos_url=meteos_url) + project_id=request.user.tenant_id, + input_auth_token=request.user.token.id, + meteos_url=meteos_url) return c @@ -130,12 +130,12 @@ def dataset_delete(request, id): def dataset_list(request, search_opts=None, limit=None, marker=None, - sort_key=None, sort_dir=None): + sort_key=None, sort_dir=None): return meteosclient(request).datasets.list(search_opts, - limit, - marker, - sort_key, - sort_dir) + limit, + marker, + sort_key, + sort_dir) def dataset_show(request, id): @@ -158,7 +158,7 @@ def model_delete(request, id): def model_list(request, search_opts=None, limit=None, marker=None, - sort_key=None, sort_dir=None): + sort_key=None, sort_dir=None): return meteosclient(request).models.list(search_opts, limit, marker, @@ -186,7 +186,7 @@ def model_evaluation_delete(request, id): def model_evaluation_list(request, search_opts=None, limit=None, marker=None, - sort_key=None, sort_dir=None): + sort_key=None, sort_dir=None): return meteosclient(request).model_evaluations.list(search_opts, limit, marker, @@ -214,12 +214,12 @@ def learning_delete(request, id): def learning_list(request, search_opts=None, limit=None, marker=None, - sort_key=None, sort_dir=None): + sort_key=None, sort_dir=None): return meteosclient(request).learnings.list(search_opts, - limit, - marker, - sort_key, - sort_dir) + limit, + marker, + sort_key, + sort_dir) def learning_show(request, id): diff --git a/meteos_ui/api/rest_api.py b/meteos_ui/api/rest_api.py index 3d615b7..052223b 100644 --- a/meteos_ui/api/rest_api.py +++ b/meteos_ui/api/rest_api.py @@ -26,7 +26,7 @@ class Template(generic.View): @rest_utils.ajax() def get(self, request, id): """Get a specific template""" - return change_to_id(client.template_show(request, id).to_dict()) + return client.template_show(request, id).to_dict() @urls.register @@ -79,7 +79,7 @@ class Experiment(generic.View): @rest_utils.ajax() def get(self, request, id): """Get a specific experiment""" - return change_to_id(client.experiment_show(request, id).to_dict()) + return client.experiment_show(request, id).to_dict() @urls.register @@ -132,7 +132,7 @@ class Dataset(generic.View): @rest_utils.ajax() def get(self, request, id): """Get a specific dataset""" - return change_to_id(client.dataset_show(request, id).to_dict()) + return client.dataset_show(request, id).to_dict() @urls.register @@ -185,7 +185,7 @@ class Model(generic.View): @rest_utils.ajax() def get(self, request, id): """Get a specific model""" - return change_to_id(client.model_show(request, id).to_dict()) + return client.model_show(request, id).to_dict() @urls.register @@ -238,7 +238,7 @@ class ModelEvaluation(generic.View): @rest_utils.ajax() def get(self, request, id): """Get a specific model_evaluation""" - return change_to_id(client.model_evaluation_show(request, id).to_dict()) + return client.model_evaluation_show(request, id).to_dict() @urls.register @@ -292,7 +292,7 @@ class Learning(generic.View): @rest_utils.ajax() def get(self, request, id): """Get a specific learning""" - return change_to_id(client.learning_show(request, id).to_dict()) + return client.learning_show(request, id).to_dict() @urls.register diff --git a/meteos_ui/enabled/_1760_machine_learning_model_evaluations_panel.py b/meteos_ui/enabled/_1760_machine_learning_model_evaluations_panel.py index 7792c96..e2bc8bc 100644 --- a/meteos_ui/enabled/_1760_machine_learning_model_evaluations_panel.py +++ b/meteos_ui/enabled/_1760_machine_learning_model_evaluations_panel.py @@ -18,4 +18,5 @@ PANEL_GROUP = 'machine_learning' PANEL_DASHBOARD = 'project' # Python panel class of the PANEL to be added. -ADD_PANEL = 'meteos_ui.content.machine_learning.model_evaluations.panel.ModelEvaluations' +ADD_PANEL = 'meteos_ui.content.machine_learning.model_evaluations.panel.\ + ModelEvaluations' diff --git a/meteos_ui/test/settings.py b/meteos_ui/test/settings.py index 47923b1..c042e58 100644 --- a/meteos_ui/test/settings.py +++ b/meteos_ui/test/settings.py @@ -22,6 +22,7 @@ HORIZON_CONFIG.pop('default_dashboard', None) # Update the dashboards with meteos_ui import openstack_dashboard.enabled from openstack_dashboard.utils import settings + import meteos_ui.enabled settings.update_dashboards( diff --git a/tox.ini b/tox.ini index 40af987..32bbfd1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py34,py27,py27dj18,pep8 +envlist = py35,py34,py27,py27dj18,pep8 minversion = 2.0 skipsdist = True @@ -18,6 +18,12 @@ deps = -r{toxinidir}/requirements.txt commands = python manage.py test {posargs} --settings=meteos_ui.test.settings # Until python-meteosclient released, install from github temporary. +[testenv:py35] +basepython = python3.5 +commands = + pip install git+https://github.com/openstack/python-meteosclient.git + python manage.py test {posargs} --settings=meteos_ui.test.settings + [testenv:py27] basepython = python2.7 commands =