Correcting additional flake8 failures on server.py
Corrected: F401 imported but unused E265 block comment should start with '# ' E501 line too long
This commit is contained in:
+7
-7
@@ -1,18 +1,14 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from tzlocal import get_localzone
|
from tzlocal import get_localzone
|
||||||
import pytz
|
|
||||||
from time import sleep
|
|
||||||
import datetime
|
import datetime
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
from decimal import Decimal
|
|
||||||
import time
|
import time
|
||||||
import math
|
import math
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import librosa
|
import librosa
|
||||||
import operator
|
import operator
|
||||||
import argparse
|
|
||||||
import socket
|
import socket
|
||||||
import threading
|
import threading
|
||||||
import os
|
import os
|
||||||
@@ -436,7 +432,8 @@ def handle_client(conn, addr):
|
|||||||
soundscape_uploaded = True
|
soundscape_uploaded = True
|
||||||
|
|
||||||
# POST detection to server
|
# POST detection to server
|
||||||
detection_url = "https://app.birdweather.com/api/v1/stations/" + birdweather_id + "/detections"
|
detection_url = "https://app.birdweather.com/api/v1/stations/" + \
|
||||||
|
birdweather_id + "/detections"
|
||||||
start_time = d.split(';')[0]
|
start_time = d.split(';')[0]
|
||||||
end_time = d.split(';')[1]
|
end_time = d.split(';')[1]
|
||||||
post_begin = "{ "
|
post_begin = "{ "
|
||||||
@@ -454,8 +451,11 @@ def handle_client(conn, addr):
|
|||||||
post_confidence = "\"confidence\": " + str(entry[1])
|
post_confidence = "\"confidence\": " + str(entry[1])
|
||||||
post_end = " }"
|
post_end = " }"
|
||||||
|
|
||||||
post_json = post_begin + post_timestamp + post_lat + post_lon + post_soundscape_id + post_soundscape_start_time + \
|
post_json = post_begin + \
|
||||||
post_soundscape_end_time + post_commonName + post_scientificName + post_algorithm + post_confidence + post_end
|
post_timestamp + post_lat + post_lon + \
|
||||||
|
post_soundscape_id + post_soundscape_start_time + \
|
||||||
|
post_soundscape_end_time + post_commonName + post_scientificName + \
|
||||||
|
post_algorithm + post_confidence + post_end
|
||||||
print(post_json)
|
print(post_json)
|
||||||
response = requests.post(detection_url, json=json.loads(post_json))
|
response = requests.post(detection_url, json=json.loads(post_json))
|
||||||
print("Detection POST Response Status - ", response.status_code)
|
print("Detection POST Response Status - ", response.status_code)
|
||||||
|
|||||||
Reference in New Issue
Block a user