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 tzlocal import get_localzone
|
||||
import pytz
|
||||
from time import sleep
|
||||
import datetime
|
||||
import sqlite3
|
||||
import requests
|
||||
import json
|
||||
from decimal import Decimal
|
||||
import time
|
||||
import math
|
||||
import numpy as np
|
||||
import librosa
|
||||
import operator
|
||||
import argparse
|
||||
import socket
|
||||
import threading
|
||||
import os
|
||||
@@ -436,7 +432,8 @@ def handle_client(conn, addr):
|
||||
soundscape_uploaded = True
|
||||
|
||||
# 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]
|
||||
end_time = d.split(';')[1]
|
||||
post_begin = "{ "
|
||||
@@ -454,8 +451,11 @@ def handle_client(conn, addr):
|
||||
post_confidence = "\"confidence\": " + str(entry[1])
|
||||
post_end = " }"
|
||||
|
||||
post_json = post_begin + 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
|
||||
post_json = post_begin + \
|
||||
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)
|
||||
response = requests.post(detection_url, json=json.loads(post_json))
|
||||
print("Detection POST Response Status - ", response.status_code)
|
||||
|
||||
Reference in New Issue
Block a user