From a7671dc1540b129e89b867f946e5096f6b8d4a88 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Wed, 6 Jan 2021 22:21:02 +0100 Subject: [PATCH 1/6] add 10s timeout and multimon restart for rtl_fm crash --- boswatch/inputSource/sdrInput.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/boswatch/inputSource/sdrInput.py b/boswatch/inputSource/sdrInput.py index dcac725..6b1faf7 100644 --- a/boswatch/inputSource/sdrInput.py +++ b/boswatch/inputSource/sdrInput.py @@ -15,6 +15,7 @@ @description: Input source for sdr with rtl_fm """ import logging +import time from boswatch.utils import paths from boswatch.processManager import ProcessManager from boswatch.inputSource.inputBase import InputBase @@ -47,8 +48,14 @@ class SdrInput(InputBase): logging.info("start decoding") while self._isRunning: if not sdrProc.isRunning: - logging.warning("rtl_fm was down - try to restart") + logging.warning("rtl_fm was down - trying to restart in 10 seconds") + time.sleep(10) + sdrProc.start() + if sdrProc.isRunning: + logging.info("rtl_fm is back up - restarting multimon...") + mmProc.setStdin(sdrProc.stdout) + mmProc.start() elif not mmProc.isRunning: logging.warning("multimon was down - try to restart") mmProc.start() From 2b4e1c1bda472db4da7b61e2aeffa86ab38893cf Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Wed, 6 Jan 2021 22:47:37 +0100 Subject: [PATCH 2/6] update pytest plugins and options --- requirements.txt | 2 +- test/pytest.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index b401509..580f9da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,6 @@ mkdocs # for develope only pytest pytest-cov -pytest-pep8 +pytest-flake8 pytest-flakes pytest-randomly diff --git a/test/pytest.ini b/test/pytest.ini index e5d4311..3affa4c 100644 --- a/test/pytest.ini +++ b/test/pytest.ini @@ -8,7 +8,7 @@ # by Bastian Schroll [pytest] -addopts = -v --pep8 --flakes --cov=boswatch/ --cov=module/ --cov plugin/ --cov-report=term-missing --log-level=CRITICAL +addopts = -v --flake8 --flakes --cov=boswatch/ --cov=module/ --cov plugin/ --cov-report=term-missing --log-level=CRITICAL # classic or progress console_output_style = progress From 21081360e2d8e8326f782e8d4a9252d804293a3d Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Wed, 6 Jan 2021 22:53:16 +0100 Subject: [PATCH 3/6] change pytest config for flake8 --- test/pytest.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/pytest.ini b/test/pytest.ini index 3affa4c..a370fa7 100644 --- a/test/pytest.ini +++ b/test/pytest.ini @@ -18,8 +18,8 @@ log_file_level=debug log_file_format=%(asctime)s - %(module)-12s %(funcName)-15s [%(levelname)-8s] %(message)s log_file_date_format=%d.%m.%Y %H:%M:%S -#pep8 plugin -pep8ignore = E402 E501 +#flake8 plugin +flake8-ignore = E402 E501 # E402 # import not at top # E501 # line too long -# pep8maxlinelength = 99 \ No newline at end of file +# flake8-max-line-length = 99 \ No newline at end of file From d67478690cf3d7ce8132e5b617f04e420833012f Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Wed, 6 Jan 2021 23:19:59 +0100 Subject: [PATCH 4/6] ignore E722 and W605 for now because they produce a lot of errors --- test/pytest.ini | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/pytest.ini b/test/pytest.ini index a370fa7..0e2272d 100644 --- a/test/pytest.ini +++ b/test/pytest.ini @@ -19,7 +19,9 @@ log_file_format=%(asctime)s - %(module)-12s %(funcName)-15s [%(levelname)-8s] %( log_file_date_format=%d.%m.%Y %H:%M:%S #flake8 plugin -flake8-ignore = E402 E501 +flake8-ignore = E402 E501 E722 W605 # E402 # import not at top # E501 # line too long +# E722 # do not use bare 'except' +# W605 # invalid escape sequence # flake8-max-line-length = 99 \ No newline at end of file From 9363fc80d5ecf7a5f4958e46f5298eae90a15f09 Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Wed, 6 Jan 2021 23:42:51 +0100 Subject: [PATCH 5/6] add W504 to flake8-ignore because of some weird error involving W503 --- test/pytest.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/pytest.ini b/test/pytest.ini index 0e2272d..b2fdf96 100644 --- a/test/pytest.ini +++ b/test/pytest.ini @@ -19,9 +19,10 @@ log_file_format=%(asctime)s - %(module)-12s %(funcName)-15s [%(levelname)-8s] %( log_file_date_format=%d.%m.%Y %H:%M:%S #flake8 plugin -flake8-ignore = E402 E501 E722 W605 +flake8-ignore = E402 E501 E722 W504 W605 # E402 # import not at top # E501 # line too long # E722 # do not use bare 'except' +# W504 # line break after binary operator # W605 # invalid escape sequence # flake8-max-line-length = 99 \ No newline at end of file From ae2dfc995460e3617ed9849383c2efb4d6e66f2b Mon Sep 17 00:00:00 2001 From: Jan Speller Date: Thu, 7 Jan 2021 11:53:17 +0100 Subject: [PATCH 6/6] Add Python 3.9 to pytest ci stage --- .github/workflows/run_pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_pytest.yml b/.github/workflows/run_pytest.yml index 30b9fe5..5e374e9 100644 --- a/.github/workflows/run_pytest.yml +++ b/.github/workflows/run_pytest.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] runs-on: ${{matrix.os}} steps: