summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ick2/__init__.py2
-rw-r--r--ick2/controllerapi.py11
-rw-r--r--ick2/workerapi.py25
-rw-r--r--without-tests3
4 files changed, 28 insertions, 13 deletions
diff --git a/ick2/__init__.py b/ick2/__init__.py
index 0ba03c5..4321f67 100644
--- a/ick2/__init__.py
+++ b/ick2/__init__.py
@@ -30,9 +30,9 @@ from .responses import (
)
from .apibase import APIbase, ResourceApiBase
from .versionapi import VersionAPI
+from .workerapi import WorkerAPI
from .controllerapi import (
ControllerAPI,
ProjectAPI,
WorkAPI,
- WorkerAPI,
)
diff --git a/ick2/controllerapi.py b/ick2/controllerapi.py
index 49c972b..62b7056 100644
--- a/ick2/controllerapi.py
+++ b/ick2/controllerapi.py
@@ -34,7 +34,7 @@ class ControllerAPI:
'/logs': LogAPI,
'/projects': ProjectAPI,
'/work': WorkAPI,
- '/workers': WorkerAPI,
+ '/workers': ick2.WorkerAPI,
}
routes = []
@@ -46,15 +46,6 @@ class ControllerAPI:
return routes
-class WorkerAPI(ick2.ResourceApiBase): # pragma: no cover
-
- def __init__(self, state):
- super().__init__('workers', state)
-
- def get_resource_name(self, resource):
- return resource['worker']
-
-
class BuildsAPI(ick2.ResourceApiBase): # pragma: no cover
def __init__(self, state):
diff --git a/ick2/workerapi.py b/ick2/workerapi.py
new file mode 100644
index 0000000..5a7e835
--- /dev/null
+++ b/ick2/workerapi.py
@@ -0,0 +1,25 @@
+# Copyright (C) 2017 Lars Wirzenius
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+import ick2
+
+
+class WorkerAPI(ick2.ResourceApiBase): # pragma: no cover
+
+ def __init__(self, state):
+ super().__init__('workers', state)
+
+ def get_resource_name(self, resource):
+ return resource['worker']
diff --git a/without-tests b/without-tests
index 099db74..097472c 100644
--- a/without-tests
+++ b/without-tests
@@ -5,5 +5,4 @@ ick2/logging.py
ick2/responses.py
ick2/version.py
ick2/versionapi.py
-
-
+ick2/workerapi.py