From aa8e916e4bb16284a9b568439951e05dd8b256e0 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Mon, 29 Jun 2020 15:37:23 +0100 Subject: [PATCH] Converted to LT070 --- openflexure_microscope/api/dev_extensions/tools.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/openflexure_microscope/api/dev_extensions/tools.py b/openflexure_microscope/api/dev_extensions/tools.py index 564dcd6d..3d0077b3 100644 --- a/openflexure_microscope/api/dev_extensions/tools.py +++ b/openflexure_microscope/api/dev_extensions/tools.py @@ -2,7 +2,6 @@ from labthings.server.extensions import BaseExtension from labthings.server.view import ActionView from labthings.server import fields -from labthings.server.decorators import use_args, marshal_with import logging import time @@ -12,12 +11,9 @@ class RaiseException(ActionView): raise Exception("The developer raised an exception") class SleepFor(ActionView): - @marshal_with({ - "TimeAsleep": fields.Float() - }) - @use_args({ - "time": fields.Float(description="Time to sleep, in seconds", example=0.5) - }) + schema = {"TimeAsleep": fields.Float()} + args = {"time": fields.Float(description="Time to sleep, in seconds", example=0.5)} + def post(self, args): sleep_time = args.get("time") logging.info(f"Going to sleep for {sleep_time}...")