More lint fixes
This commit is contained in:
parent
3a6aa8f3d1
commit
f3352546c6
1 changed files with 7 additions and 4 deletions
|
@ -44,6 +44,7 @@ class MjpegCamera(Camera):
|
||||||
""" Return a still image reponse from the camera. """
|
""" Return a still image reponse from the camera. """
|
||||||
|
|
||||||
def process_response(response):
|
def process_response(response):
|
||||||
|
""" Take in a response obj, return the jpg from it. """
|
||||||
data = b''
|
data = b''
|
||||||
for chunk in response.iter_content(1024):
|
for chunk in response.iter_content(1024):
|
||||||
data += chunk
|
data += chunk
|
||||||
|
@ -54,12 +55,14 @@ class MjpegCamera(Camera):
|
||||||
return jpg
|
return jpg
|
||||||
|
|
||||||
if self._username and self._password:
|
if self._username and self._password:
|
||||||
with closing(requests.get(self._mjpeg_url, auth = HTTPBasicAuth(
|
with closing(requests.get(self._mjpeg_url,
|
||||||
self._username, self._password), stream = True)) as response:
|
auth=HTTPBasicAuth(self._username,
|
||||||
|
self._password),
|
||||||
|
stream=True)) as response:
|
||||||
return process_response(response)
|
return process_response(response)
|
||||||
else:
|
else:
|
||||||
with closing(requests.get(self._mjpeg_url,
|
with closing(requests.get(self._mjpeg_url,
|
||||||
stream = True)) as response:
|
stream=True)) as response:
|
||||||
return process_response(response)
|
return process_response(response)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Add table
Reference in a new issue