From a4aab52619713f4997504355a82984ff1df7ef8c Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Wed, 8 Jul 2020 15:35:52 +0100 Subject: [PATCH] Removed APISpec module dependence from TD --- src/labthings/labthing.py | 2 +- src/labthings/td.py | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/labthings/labthing.py b/src/labthings/labthing.py index 5bf14ed2..763683ac 100644 --- a/src/labthings/labthing.py +++ b/src/labthings/labthing.py @@ -95,7 +95,7 @@ def __init__( ) # Thing description - self.thing_description = ThingDescription(self.spec) + self.thing_description = ThingDescription() if app is not None: self.init_app(app) diff --git a/src/labthings/td.py b/src/labthings/td.py index 9adadbe9..7e5ff936 100644 --- a/src/labthings/td.py +++ b/src/labthings/td.py @@ -1,19 +1,12 @@ from flask import url_for, request -from apispec import APISpec -import weakref from .view import View from .event import Event - from .json.schemas import schema_to_json from .json.paths import rule_to_params, rule_to_path - from .find import current_labthing - from .utilities import get_docstring, snake_to_camel -# TODO: Remove reliance on get_apispec() methods - def view_to_thing_action_forms(rules: list, view: View): """Build a W3C form description for an ActionView @@ -136,18 +129,13 @@ def view_to_thing_property_forms(rules: list, view: View): class ThingDescription: - def __init__(self, apispec: APISpec): - self._apispec = weakref.ref(apispec) + def __init__(self): self.properties = {} self.actions = {} self.events = {} self._links = [] super().__init__() - @property - def apispec(self): - return self._apispec() - @property def links(self): td_links = []