vscode configuartion added and pep8 for python file
This commit is contained in:
parent
f7f242af10
commit
310ed74515
16
.vscode/launch.json
vendored
Normal file
16
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
// Verwendet IntelliSense zum Ermitteln möglicher Attribute.
|
||||
// Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen.
|
||||
// Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Python: Main File execution",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/loggy.py",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": true
|
||||
}
|
||||
]
|
||||
}
|
14
.vscode/settings.json
vendored
Normal file
14
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"python.defaultInterpreterPath": "./venv/bin/python",
|
||||
"autopep8.args": ["--max-line-length=150"],
|
||||
"[python]": {
|
||||
"python.formatting.provider": "none",
|
||||
"editor.defaultFormatter": "ms-python.autopep8",
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"editor.fontSize": 14,
|
||||
"emmet.includeLanguages": { "django-html": "html" },
|
||||
"python.testing.pytestArgs": ["-v", "--cov", "--cov-report=xml", "__test__"],
|
||||
"python.testing.unittestEnabled": false,
|
||||
"python.testing.pytestEnabled": true
|
||||
}
|
12
loggy.py
12
loggy.py
@ -45,7 +45,7 @@ class LogReceiver(threading.Thread):
|
||||
chunk = conn.recv(slen)
|
||||
while len(chunk) < slen:
|
||||
chunk = chunk + conn.recv(slen - len(chunk))
|
||||
|
||||
|
||||
obj = pickle.loads(chunk)
|
||||
log_record = logging.makeLogRecord(obj)
|
||||
|
||||
@ -117,17 +117,17 @@ class LogViewerApp(App):
|
||||
|
||||
if self._force(record.levelname.lower()) or (module_match and level_match):
|
||||
level_style = LEVEL_STYLES.get(record.levelname, "white")
|
||||
|
||||
|
||||
timestamp_str = datetime.fromtimestamp(record.created).strftime("%Y-%m-%d %H:%M:%S")
|
||||
asctime = f"{timestamp_str},{int(record.msecs):03d}"
|
||||
|
||||
|
||||
message = (
|
||||
f"[[dim]{asctime}[/dim]] "
|
||||
f"[{level_style}]{record.levelname:<8}[/{level_style}] "
|
||||
f"[bold]{record.name}[/bold] - "
|
||||
f"{record.getMessage()}"
|
||||
)
|
||||
|
||||
|
||||
self.log_display.write(message)
|
||||
|
||||
def action_clear_screen(self):
|
||||
@ -146,7 +146,7 @@ class LogViewerApp(App):
|
||||
self.module_filter = message.value
|
||||
elif message.input.id == "level_filter":
|
||||
self.level_filter = message.value
|
||||
|
||||
|
||||
self._update_display()
|
||||
|
||||
def on_checkbox_changed(self, message: Checkbox.Changed) -> None:
|
||||
@ -156,7 +156,7 @@ class LogViewerApp(App):
|
||||
self.force_error = message.value
|
||||
elif message.checkbox.id == "force_warning":
|
||||
self.force_warning = message.value
|
||||
|
||||
|
||||
self._update_display()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user