Skip to content

Commit

Permalink
Removed APISpec module dependence from TD
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Collins committed Jul 8, 2020
1 parent 4002f81 commit a4aab52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/labthings/labthing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 1 addition & 13 deletions src/labthings/td.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 = []
Expand Down

0 comments on commit a4aab52

Please sign in to comment.