Skip to content

Commit 160cbd8

Browse files
author
Joel Collins
committed
Removed unused Event import
1 parent eac0cea commit 160cbd8

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/labthings/views/__init__.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
from ..actions.pool import Pool
1111
from ..deque import Deque
12-
from ..event import PropertyStatusEvent
1312
from ..find import current_labthing
1413
from ..marshalling import marshal_with, use_args
1514
from ..representations import DEFAULT_REPRESENTATIONS
@@ -180,12 +179,6 @@ def dispatch_request(self, *args, **kwargs):
180179
if self.default_stop_timeout is not None:
181180
task.default_stop_timeout = self.default_stop_timeout
182181

183-
# Keep a copy of the raw, unmarshalled JSON input in the task
184-
try:
185-
task.input = request.json
186-
except BadRequest:
187-
task.input = None
188-
189182
# Wait up to 2 second for the action to complete or error
190183
try:
191184
task.get(block=True, timeout=self.wait_for)
@@ -239,22 +232,7 @@ def dispatch_request(self, *args, **kwargs):
239232
meth = marshal_with(self.schema)(meth)
240233

241234
# Generate basic response
242-
resp = self.represent_response(meth(*args, **kwargs))
243-
244-
# Emit property event
245-
if request.method in ("POST", "PUT"):
246-
property_value = self.get_value()
247-
property_name = getattr(self, "endpoint", None) or getattr(
248-
self, "__name__", "unknown"
249-
)
250-
251-
if current_labthing():
252-
current_labthing().message(
253-
PropertyStatusEvent(property_name),
254-
property_value,
255-
)
256-
257-
return resp
235+
return self.represent_response(meth(*args, **kwargs))
258236

259237

260238
class EventView(View):

0 commit comments

Comments
 (0)