Skip to content

Commit a4aab52

Browse files
author
Joel Collins
committed
Removed APISpec module dependence from TD
1 parent 4002f81 commit a4aab52

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/labthings/labthing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __init__(
9595
)
9696

9797
# Thing description
98-
self.thing_description = ThingDescription(self.spec)
98+
self.thing_description = ThingDescription()
9999

100100
if app is not None:
101101
self.init_app(app)

src/labthings/td.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
from flask import url_for, request
2-
from apispec import APISpec
3-
import weakref
42

53
from .view import View
64
from .event import Event
7-
85
from .json.schemas import schema_to_json
96
from .json.paths import rule_to_params, rule_to_path
10-
117
from .find import current_labthing
12-
138
from .utilities import get_docstring, snake_to_camel
149

15-
# TODO: Remove reliance on get_apispec() methods
16-
1710

1811
def view_to_thing_action_forms(rules: list, view: View):
1912
"""Build a W3C form description for an ActionView
@@ -136,18 +129,13 @@ def view_to_thing_property_forms(rules: list, view: View):
136129

137130

138131
class ThingDescription:
139-
def __init__(self, apispec: APISpec):
140-
self._apispec = weakref.ref(apispec)
132+
def __init__(self):
141133
self.properties = {}
142134
self.actions = {}
143135
self.events = {}
144136
self._links = []
145137
super().__init__()
146138

147-
@property
148-
def apispec(self):
149-
return self._apispec()
150-
151139
@property
152140
def links(self):
153141
td_links = []

0 commit comments

Comments
 (0)