vscode configuartion added and pep8 for python file

This commit is contained in:
Dirk Alders 2025-07-23 18:12:17 +02:00
parent 7008ec077b
commit 1db7cb2451
3 changed files with 7 additions and 8 deletions

6
.vscode/launch.json vendored
View File

@ -9,9 +9,9 @@
"type": "python", "type": "python",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/mqtt_sniffer.py", "program": "${workspaceFolder}/mqtt_sniffer.py",
"console": "externalTerminal", "console": "integratedTerminal",
"args": ["-n", "-u", "smarthome", "-t", "es.*t", "-l"], "args": ["-f", "mqtt.home", "-p", "1884", "-n"],
"justMyCode": true "justMyCode": true
} }
] ]
} }

View File

@ -1,15 +1,14 @@
{ {
"python.defaultInterpreterPath": "./venv/bin/python", "python.defaultInterpreterPath": "./venv/bin/python",
"autopep8.args": ["--max-line-length=150"], "autopep8.args": ["--max-line-length=150"],
"python.formatting.provider": "none",
"[python]": { "[python]": {
"editor.defaultFormatter": "ms-python.python", "python.formatting.provider": "none",
"editor.defaultFormatter": "ms-python.autopep8",
"editor.formatOnSave": true "editor.formatOnSave": true
}, },
"editor.formatOnSave": true,
"editor.fontSize": 14, "editor.fontSize": 14,
"emmet.includeLanguages": { "django-html": "html" }, "emmet.includeLanguages": { "django-html": "html" },
"python.testing.pytestArgs": ["-v", "--cov", "--cov-report=xml", "__test__"], "python.testing.pytestArgs": ["-v", "--cov", "--cov-report=xml", "__test__"],
"python.testing.unittestEnabled": false, "python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true, "python.testing.pytestEnabled": true
} }

View File

@ -40,6 +40,7 @@ class MqttHandler(object):
logger.debug("Sending message: topic=%s, payload=%s type=%s", topic, repr(payload), repr(type(payload))) logger.debug("Sending message: topic=%s, payload=%s type=%s", topic, repr(payload), repr(type(payload)))
self.mqtt_client.send(topic, payload) self.mqtt_client.send(topic, payload)
class MqttSniffer(App): class MqttSniffer(App):
"""a textual application for viewing mqtt messages.""" """a textual application for viewing mqtt messages."""
@ -109,7 +110,6 @@ class MqttSniffer(App):
self.all_logs = [] self.all_logs = []
self._update_display() self._update_display()
def _update_display(self): def _update_display(self):
"""Clean the display and render all mqtt messages based on the current filters.""" """Clean the display and render all mqtt messages based on the current filters."""
self.log_display.clear() self.log_display.clear()