Code formatting
This commit is contained in:
parent
0234b20ce3
commit
2bfb988460
60 changed files with 392 additions and 396 deletions
|
|
@ -1,14 +1,16 @@
|
|||
import logging
|
||||
import time
|
||||
|
||||
from labthings import fields
|
||||
from labthings.extensions import BaseExtension
|
||||
from labthings.views import ActionView
|
||||
|
||||
import logging
|
||||
import time
|
||||
|
||||
class RaiseException(ActionView):
|
||||
def post(self):
|
||||
raise Exception("The developer raised an exception")
|
||||
|
||||
|
||||
class SleepFor(ActionView):
|
||||
schema = {"TimeAsleep": fields.Float()}
|
||||
args = {"time": fields.Float(description="Time to sleep, in seconds", example=0.5)}
|
||||
|
|
@ -22,6 +24,7 @@ class SleepFor(ActionView):
|
|||
logging.info("Waking up!")
|
||||
return {"TimeAsleep": (end - start)}
|
||||
|
||||
|
||||
devtools_extension_v2 = BaseExtension(
|
||||
"org.openflexure.dev.tools",
|
||||
version="0.1.0",
|
||||
|
|
@ -29,4 +32,4 @@ devtools_extension_v2 = BaseExtension(
|
|||
)
|
||||
|
||||
devtools_extension_v2.add_view(RaiseException, "/raise")
|
||||
devtools_extension_v2.add_view(SleepFor, "/sleep")
|
||||
devtools_extension_v2.add_view(SleepFor, "/sleep")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue