From b44936f010fb732300d1a20d205bd4b932aae166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Lombra=C3=B1a=20Gonz=C3=A1lez?= Date: Mon, 9 Mar 2015 13:00:38 +0100 Subject: [PATCH] Fixes. --- enki/__init__.py | 14 +++++++------- setup.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/enki/__init__.py b/enki/__init__.py index a6bc0f0..b2e1a94 100644 --- a/enki/__init__.py +++ b/enki/__init__.py @@ -24,8 +24,8 @@ """ import pandas import pbclient -from exceptions import AppNotFound, AppError, \ - AppWithoutTasks, AppWithoutTaskRuns +from exceptions import ProjectNotFound, ProjectError, \ + ProjectWithoutTasks, ProjectWithoutTaskRuns class Enki(object): @@ -49,7 +49,7 @@ def get_project(self, project_short_name): if (len(project) == 1): return project[0] else: - raise AppNotFound(project_short_name) + raise ProjectNotFound(project_short_name) def explode_info(self, item): """Return the a dict of the object but with info field exploded.""" @@ -81,7 +81,7 @@ def get_tasks(self, task_id=None, state='completed'): limit=limit, offset=offset) else: - raise AppError() + raise ProjectError() tmp = self.pbclient.find_tasks(**query) while(len(tmp) != 0): @@ -97,7 +97,7 @@ def get_tasks(self, task_id=None, state='completed'): index = [t.__dict__['data']['id'] for t in self.tasks] self.tasks_df = pandas.DataFrame(data, index) except: - raise AppWithoutTasks + raise ProjectWithoutTasks def get_task_runs(self): """Load all project Task Runs from Tasks.""" @@ -127,9 +127,9 @@ def get_task_runs(self): self.task_runs[t.id]] self.task_runs_df[t.id] = pandas.DataFrame(data, index) else: - raise AppWithoutTaskRuns + raise ProjectWithoutTaskRuns else: - raise AppError() + raise ProjectError() def get_all(self): # pragma: no cover """Get task and task_runs from project.""" diff --git a/setup.py b/setup.py index 3d94ee1..397d9e5 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='enki', - version='0.0.2', + version='0.0.3', packages=find_packages(), install_requires=['pybossa-client>=1.0.0, <1.0.1', 'pandas'], # metadata for upload to PyPI