|
1 | 1 | """High-level Action base class implementation.""" |
2 | 2 |
|
3 | | -from copy import deepcopy |
4 | | -import uuid |
5 | 3 | import asyncio |
| 4 | +import uuid |
| 5 | +from copy import deepcopy |
| 6 | + |
6 | 7 | from .utils import timestamp |
7 | 8 |
|
8 | 9 |
|
@@ -133,7 +134,9 @@ def finish(self, future): |
133 | 134 | class Action: |
134 | 135 | """An Action represents a class of actions on a thing.""" |
135 | 136 |
|
136 | | - def __init__(self, thing, name, invokeaction=None, metadata=None, input_=None, output=None): |
| 137 | + def __init__( |
| 138 | + self, thing, name, invokeaction=None, metadata=None, input_=None, output=None |
| 139 | + ): |
137 | 140 | self.thing = thing |
138 | 141 | self.name = name |
139 | 142 | self.href_prefix = "" |
@@ -168,10 +171,19 @@ def as_action_description(self): |
168 | 171 | "href": {"type": "string", "format": "uri"}, |
169 | 172 | "timeRequested": {"type": "string", "format": "date-time"}, |
170 | 173 | "timeCompleted": {"type": "string", "format": "date-time"}, |
171 | | - "status": {"type": "string", "enum": ["pending", "running", "completed", "cancelled", "error"]}, |
| 174 | + "status": { |
| 175 | + "type": "string", |
| 176 | + "enum": [ |
| 177 | + "pending", |
| 178 | + "running", |
| 179 | + "completed", |
| 180 | + "cancelled", |
| 181 | + "error", |
| 182 | + ], |
| 183 | + }, |
172 | 184 | **({"output": self.output} if self.output else {}), |
173 | 185 | **({"input": self.input} if self.input else {}), |
174 | | - } |
| 186 | + }, |
175 | 187 | } |
176 | 188 |
|
177 | 189 | # Create forms |
|
0 commit comments