Skip to content

Commit 41d09da

Browse files
Autofix issues in 5 files
Resolved issues in the following files via DeepSource Autofix: 1. examples/simple_thing.py 2. src/labthings/__init__.py 3. src/labthings/views/__init__.py 4. src/labthings/wsgi.py 5. tests/conftest.py
1 parent 47e56e6 commit 41d09da

File tree

5 files changed

+3
-12
lines changed

5 files changed

+3
-12
lines changed

examples/simple_thing.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/usr/bin/env python
2-
import time
32

43
from labthings import ActionView, PropertyView, create_app, fields, find_component, op
54
from labthings.example_components import PretendSpectrometer
6-
from labthings.json import encode_json
75

86
"""
97
Class for our lab component functionality. This could include serial communication,

src/labthings/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"views",
5656
"fields",
5757
"Schema",
58-
"semantics",
5958
"json",
6059
"PropertyView",
6160
"ActionView",

src/labthings/views/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ def get_value(self):
5959
if not callable(get_method):
6060
raise TypeError("Attribute 'get' of View must be a callable")
6161
response = get_method() # pylint: disable=not-callable
62-
if isinstance(response, ResponseBase): # Pluck useful data out of HTTP response
63-
return response.json if response.json else response.data
64-
else: # Unless somehow an HTTP response isn't returned...
65-
return response
62+
if isinstance(response, ResponseBase): # Pluck useful data out of HTTP response
63+
return response.json if response.json else response.data
64+
return response
6665

6766
def _find_request_method(self):
6867
meth = getattr(self, request.method.lower(), None)

src/labthings/wsgi.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import logging
2-
import signal
31
import socket
4-
import threading
52
import hashlib
63

74
from werkzeug.serving import run_simple
8-
from werkzeug.debug import DebuggedApplication
95
from zeroconf import IPVersion, ServiceInfo, Zeroconf, get_all_addresses
106

117
from .find import current_labthing

tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from flask import Flask
99
from flask.testing import FlaskClient
1010
from flask.views import MethodView
11-
from werkzeug.test import EnvironBuilder
1211

1312
from labthings import LabThing
1413
from labthings.actions import Pool

0 commit comments

Comments
 (0)