Skip to content

Commit

Permalink
Fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
teleyinex committed Mar 9, 2015
1 parent d1dffc8 commit b44936f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions enki/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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."""
Expand Down Expand Up @@ -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):
Expand All @@ -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."""
Expand Down Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b44936f

Please sign in to comment.