mirror of
https://github.com/esphome/esphome.git
synced 2025-02-07 13:40:59 +00:00
Bump pylint from 2.7.2 to 2.8.2 (#1729)
* Bump pylint from 2.7.2 to 2.8.2 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.7.2 to 2.8.2. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Changelog](https://github.com/PyCQA/pylint/blob/master/ChangeLog) - [Commits](https://github.com/PyCQA/pylint/compare/pylint-2.7.2...v2.8.2) Signed-off-by: dependabot[bot] <support@github.com> * fix pylint Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
This commit is contained in:
parent
33bf78c369
commit
73252ccd25
@ -515,45 +515,45 @@ class MDNSStatusThread(threading.Thread):
|
|||||||
|
|
||||||
class PingStatusThread(threading.Thread):
|
class PingStatusThread(threading.Thread):
|
||||||
def run(self):
|
def run(self):
|
||||||
pool = multiprocessing.Pool(processes=8)
|
with multiprocessing.Pool(processes=8) as pool:
|
||||||
while not STOP_EVENT.is_set():
|
while not STOP_EVENT.is_set():
|
||||||
# Only do pings if somebody has the dashboard open
|
# Only do pings if somebody has the dashboard open
|
||||||
|
|
||||||
def callback(ret):
|
def callback(ret):
|
||||||
PING_RESULT[ret[0]] = ret[1]
|
PING_RESULT[ret[0]] = ret[1]
|
||||||
|
|
||||||
entries = _list_dashboard_entries()
|
entries = _list_dashboard_entries()
|
||||||
queue = collections.deque()
|
queue = collections.deque()
|
||||||
for entry in entries:
|
for entry in entries:
|
||||||
if entry.address is None:
|
if entry.address is None:
|
||||||
PING_RESULT[entry.filename] = None
|
PING_RESULT[entry.filename] = None
|
||||||
continue
|
continue
|
||||||
|
|
||||||
result = pool.apply_async(
|
result = pool.apply_async(
|
||||||
_ping_func, (entry.filename, entry.address), callback=callback
|
_ping_func, (entry.filename, entry.address), callback=callback
|
||||||
)
|
)
|
||||||
queue.append(result)
|
queue.append(result)
|
||||||
|
|
||||||
while queue:
|
while queue:
|
||||||
item = queue[0]
|
item = queue[0]
|
||||||
if item.ready():
|
if item.ready():
|
||||||
queue.popleft()
|
queue.popleft()
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
item.get(0.1)
|
item.get(0.1)
|
||||||
except OSError:
|
except OSError:
|
||||||
# ping not installed
|
# ping not installed
|
||||||
pass
|
pass
|
||||||
except multiprocessing.TimeoutError:
|
except multiprocessing.TimeoutError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if STOP_EVENT.is_set():
|
if STOP_EVENT.is_set():
|
||||||
pool.terminate()
|
pool.terminate()
|
||||||
return
|
return
|
||||||
|
|
||||||
PING_REQUEST.wait()
|
PING_REQUEST.wait()
|
||||||
PING_REQUEST.clear()
|
PING_REQUEST.clear()
|
||||||
|
|
||||||
|
|
||||||
class PingRequestHandler(BaseHandler):
|
class PingRequestHandler(BaseHandler):
|
||||||
|
@ -296,15 +296,14 @@ def run_ota_impl_(remote_host, remote_port, password, filename):
|
|||||||
_LOGGER.error("Connecting to %s:%s failed: %s", remote_host, remote_port, err)
|
_LOGGER.error("Connecting to %s:%s failed: %s", remote_host, remote_port, err)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
file_handle = open(filename, "rb")
|
with open(filename, "rb") as file_handle:
|
||||||
try:
|
try:
|
||||||
perform_ota(sock, password, file_handle, filename)
|
perform_ota(sock, password, file_handle, filename)
|
||||||
except OTAError as err:
|
except OTAError as err:
|
||||||
_LOGGER.error(str(err))
|
_LOGGER.error(str(err))
|
||||||
return 1
|
return 1
|
||||||
finally:
|
finally:
|
||||||
sock.close()
|
sock.close()
|
||||||
file_handle.close()
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
@ -60,10 +60,10 @@ def cpp_string_escape(string, encoding="utf-8"):
|
|||||||
def run_system_command(*args):
|
def run_system_command(*args):
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
with subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p:
|
||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
rc = p.returncode
|
rc = p.returncode
|
||||||
return rc, stdout, stderr
|
return rc, stdout, stderr
|
||||||
|
|
||||||
|
|
||||||
def mkdir_p(path):
|
def mkdir_p(path):
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
pylint==2.7.2
|
pylint==2.8.2
|
||||||
flake8==3.9.0
|
flake8==3.9.0
|
||||||
black==21.5b0
|
black==21.5b0
|
||||||
pillow>4.0.0
|
pillow>4.0.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user