Skip to content

Commit

Permalink
Autofix issues in 5 files
Browse files Browse the repository at this point in the history
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
  • Loading branch information
deepsource-autofix[bot] authored Sep 4, 2020
1 parent 47e56e6 commit 41d09da
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
2 changes: 0 additions & 2 deletions examples/simple_thing.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env python
import time

from labthings import ActionView, PropertyView, create_app, fields, find_component, op
from labthings.example_components import PretendSpectrometer
from labthings.json import encode_json

"""
Class for our lab component functionality. This could include serial communication,
Expand Down
1 change: 0 additions & 1 deletion src/labthings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"views",
"fields",
"Schema",
"semantics",
"json",
"PropertyView",
"ActionView",
Expand Down
7 changes: 3 additions & 4 deletions src/labthings/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ def get_value(self):
if not callable(get_method):
raise TypeError("Attribute 'get' of View must be a callable")
response = get_method() # pylint: disable=not-callable
if isinstance(response, ResponseBase): # Pluck useful data out of HTTP response
return response.json if response.json else response.data
else: # Unless somehow an HTTP response isn't returned...
return response
if isinstance(response, ResponseBase): # Pluck useful data out of HTTP response
return response.json if response.json else response.data
return response

def _find_request_method(self):
meth = getattr(self, request.method.lower(), None)
Expand Down
4 changes: 0 additions & 4 deletions src/labthings/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import logging
import signal
import socket
import threading
import hashlib

from werkzeug.serving import run_simple
from werkzeug.debug import DebuggedApplication
from zeroconf import IPVersion, ServiceInfo, Zeroconf, get_all_addresses

from .find import current_labthing
Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from flask import Flask
from flask.testing import FlaskClient
from flask.views import MethodView
from werkzeug.test import EnvironBuilder

from labthings import LabThing
from labthings.actions import Pool
Expand Down

0 comments on commit 41d09da

Please sign in to comment.