Blackened

This commit is contained in:
jtc42 2019-12-21 17:40:04 +00:00
parent 2574e38b47
commit c85bdcc91d
10 changed files with 49 additions and 30 deletions

View file

@ -11,7 +11,14 @@ from . import EXTENSION_NAME
class LabThing(object):
def __init__(self, app=None, prefix: str = "", title: str = "", description: str = "", handle_errors: bool = True):
def __init__(
self,
app=None,
prefix: str = "",
title: str = "",
description: str = "",
handle_errors: bool = True,
):
self.app = app
self.devices = {}
@ -219,7 +226,7 @@ class LabThing(object):
if self.blueprint:
if endpoint.startswith(self.blueprint.name):
endpoint = endpoint.split(self.blueprint.name + '.', 1)[-1]
endpoint = endpoint.split(self.blueprint.name + ".", 1)[-1]
else:
return False
return endpoint in self.endpoints
@ -254,4 +261,4 @@ class LabThing(object):
return jsonify(td)
# TODO: Add a nicer root resource like the old self-documenting system
# TODO: Add a nicer root resource like the old self-documenting system