28
28
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29
29
# THE SOFTWARE.
30
30
import json
31
- import logging
32
31
import threading
33
32
import time
34
33
35
- from flask import *
36
-
37
34
import board
38
35
import busio
36
+ import flask
37
+
39
38
import adafruit_bno055
40
39
41
40
i2c = busio .I2C (board .SCL , board .SDA )
65
64
66
65
67
66
# Create flask application.
68
- app = Flask (__name__ )
67
+ app = flask . Flask (__name__ )
69
68
70
69
# Global state to keep track of the latest readings from the BNO055 sensor.
71
70
# This will be accessed from multiple threads so care needs to be taken to
@@ -144,7 +143,7 @@ def start_bno_thread():
144
143
# this is the only spot to put code that can only run once after starting.
145
144
# See this SO question for more context:
146
145
# http://stackoverflow.com/questions/24617795/starting-thread-while-running-flask-with-debug
147
- global bno_thread
146
+ global bno_thread # pylint: disable=global-statement
148
147
# Kick off BNO055 reading thread.
149
148
bno_thread = threading .Thread (target = read_bno )
150
149
bno_thread .daemon = True # Don't let the BNO reading thread block exiting.
@@ -155,7 +154,7 @@ def start_bno_thread():
155
154
def bno_path ():
156
155
# Return SSE response and call bno_sse function to stream sensor data to
157
156
# the webpage.
158
- return Response (bno_sse (), mimetype = "text/event-stream" )
157
+ return flask . Response (bno_sse (), mimetype = "text/event-stream" )
159
158
160
159
161
160
@app .route ("/save_calibration" , methods = ["POST" ])
@@ -178,7 +177,7 @@ def load_calibration():
178
177
179
178
@app .route ("/" )
180
179
def root ():
181
- return render_template ("index.html" )
180
+ return flask . render_template ("index.html" )
182
181
183
182
184
183
if __name__ == "__main__" :
0 commit comments