projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Start using warnings from stdlib.
[python_utils.git]
/
google_assistant.py
diff --git
a/google_assistant.py
b/google_assistant.py
index 572b4ccdf25644992f77f66eae800ea9e306ce50..041648ca4f15e9db4ce1b1df2862d948ec450325 100644
(file)
--- a/
google_assistant.py
+++ b/
google_assistant.py
@@
-3,6
+3,7
@@
import logging
from typing import NamedTuple
import sys
import logging
from typing import NamedTuple
import sys
+import warnings
import requests
import speech_recognition as sr # type: ignore
import requests
import speech_recognition as sr # type: ignore
@@
-93,7
+94,9
@@
def ask_google(cmd: str, *, recognize_speech=True) -> GoogleResponse:
logger.debug(f"Transcription: '{audio_transcription}'")
except sr.UnknownValueError as e:
logger.exception(e)
logger.debug(f"Transcription: '{audio_transcription}'")
except sr.UnknownValueError as e:
logger.exception(e)
- logger.warning('Unable to parse Google assistant\'s response.')
+ msg = 'Unable to parse Google assistant\'s response.'
+ logger.warning(msg)
+ warnings.warn(msg)
audio_transcription = None
return GoogleResponse(
success=success,
audio_transcription = None
return GoogleResponse(
success=success,