Skip to content

Commit cac9add

Browse files
author
Joel Collins
committed
Code formatting
1 parent 9716f79 commit cac9add

File tree

8 files changed

+62
-19
lines changed

8 files changed

+62
-19
lines changed

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ sphinx-rtd-theme = "^0.5.0"
3535
[tool.black]
3636
exclude = '(\.eggs|\.git|\.venv)'
3737

38+
[tool.isort]
39+
multi_line_output=3
40+
include_trailing_comma=true
41+
force_grid_wrap=0
42+
use_parentheses=true
43+
line_length=88
44+
3845
[build-system]
3946
requires = ["poetry>=0.12"]
4047
build-backend = "poetry.masonry.api"

src/labthings/__init__.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
# Main LabThing class
22
# Submodules
3-
from . import extensions, fields, json, marshalling, semantics, views
3+
from . import extensions, fields, json, marshalling, views
44
# Action threads
5-
from .actions import (ActionKilledException, current_action,
6-
update_action_data, update_action_progress)
5+
from .actions import (
6+
ActionKilledException,
7+
current_action,
8+
update_action_data,
9+
update_action_progress,
10+
)
711
# Functions to speed up finding global objects
8-
from .find import (current_labthing, find_component, find_extension,
9-
registered_components, registered_extensions)
12+
from .find import (
13+
current_labthing,
14+
find_component,
15+
find_extension,
16+
registered_components,
17+
registered_extensions,
18+
)
1019
from .labthing import LabThing
1120
# Quick-create app+LabThing function
1221
from .quick import create_app

src/labthings/actions/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"ActionKilledException",
66
]
77

8-
from .pool import (Pool, current_action, update_action_data,
9-
update_action_progress)
8+
from .pool import Pool, current_action, update_action_data, update_action_progress
109
from .thread import ActionKilledException, ActionThread
1110

1211
__all__ = [

src/labthings/fields.py

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,37 @@
33

44
from marshmallow import ValidationError
55
from marshmallow.fields import (
6-
URL, UUID, AwareDateTime, Bool, Boolean, Constant, Date, DateTime, Decimal,
7-
Dict, Email, Field, Float, Function, Int, Integer, List, Mapping, Method,
8-
NaiveDateTime, Nested, Number, Pluck, Raw, Str, String, Time, TimeDelta,
9-
Tuple, Url)
6+
URL,
7+
UUID,
8+
AwareDateTime,
9+
Bool,
10+
Boolean,
11+
Constant,
12+
Date,
13+
DateTime,
14+
Decimal,
15+
Dict,
16+
Email,
17+
Field,
18+
Float,
19+
Function,
20+
Int,
21+
Integer,
22+
List,
23+
Mapping,
24+
Method,
25+
NaiveDateTime,
26+
Nested,
27+
Number,
28+
Pluck,
29+
Raw,
30+
Str,
31+
String,
32+
Time,
33+
TimeDelta,
34+
Tuple,
35+
Url,
36+
)
1037

1138
__all__ = [
1239
"Bytes",

src/labthings/json/marshmallow_jsonschema/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
from marshmallow.class_registry import get_class
88

99
from .exceptions import UnsupportedValueError
10-
from .validation import (handle_length, handle_one_of, handle_range,
11-
handle_regexp)
10+
from .validation import handle_length, handle_one_of, handle_range, handle_regexp
1211

1312
__all__ = ("JSONSchema",)
1413

src/labthings/labthing.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@
1919
from .httperrorhandler import SerializedExceptionHandler
2020
from .json.encoder import LabThingsJSONEncoder
2121
from .logging import LabThingLogger
22-
from .names import (ACTION_ENDPOINT, ACTION_LIST_ENDPOINT,
23-
EXTENSION_LIST_ENDPOINT, EXTENSION_NAME)
22+
from .names import (
23+
ACTION_ENDPOINT,
24+
ACTION_LIST_ENDPOINT,
25+
EXTENSION_LIST_ENDPOINT,
26+
EXTENSION_NAME,
27+
)
2428
from .representations import DEFAULT_REPRESENTATIONS
2529
from .td import ThingDescription
2630
from .utilities import camel_to_snake, clean_url_string

tests/test_default_views_socket_handler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from labthings.default_views.sockets import (process_socket_message,
2-
socket_handler)
1+
from labthings.default_views.sockets import process_socket_message, socket_handler
32

43

54
def test_socket_handler(thing_ctx, fake_websocket):

tests/test_json_marshmallow_jsonschema.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
from jsonschema import Draft7Validator
33

44
from labthings import fields
5-
from labthings.json.marshmallow_jsonschema import (JSONSchema,
6-
UnsupportedValueError)
5+
from labthings.json.marshmallow_jsonschema import JSONSchema, UnsupportedValueError
76
from labthings.schema import Schema, validate
87

98

0 commit comments

Comments
 (0)