Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Collins committed Jun 17, 2020
1 parent dc262d7 commit e789e0a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
10 changes: 7 additions & 3 deletions labthings_client/json_typing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Any
import copy


def json_to_typing_basic(schema: dict):

# Copy so we don't start popping keys from the main description
Expand All @@ -24,14 +25,17 @@ def json_to_typing_basic(schema: dict):
python_type = str
elif json_type == "object":
python_type = dict
description["properties"] = {k: json_to_typing_basic(v) for k, v in working_schema.pop("properties", {}).items()}
description["properties"] = {
k: json_to_typing_basic(v)
for k, v in working_schema.pop("properties", {}).items()
}
elif json_type == "array":
python_type = list
description["items"] = json_to_typing_basic(working_schema.pop("items",{}))
description["items"] = json_to_typing_basic(working_schema.pop("items", {}))

description["type"] = python_type

# Add in extra unused parameters
description.update(working_schema)

return description
return description
1 change: 1 addition & 0 deletions labthings_client/tasks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import requests


class ActionTask:
def __init__(self, task_description: dict):
self.task_description = task_description
Expand Down
2 changes: 1 addition & 1 deletion labthings_client/td_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def find_self_link(links_list: list):
if len(links_list) > 0:
return links_list[0].get("href")
# Failing even that, return empty string
return ""
return ""
4 changes: 2 additions & 2 deletions labthings_client/utilities.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class AttributeDict(dict):
class AttributeDict(dict):
__getattr__ = dict.__getitem__
__setattr__ = dict.__setitem__
__setattr__ = dict.__setitem__

0 comments on commit e789e0a

Please sign in to comment.