Und noch eine kleine Übung, wie man den Buttton abhängig von einem Value enabled/disabled
# we build header and tdata for table tab_mount = [] for count, value in enumerate(backups): if count == 0: tab_mount.append(['No.', 'Backup name of the restic data backup', 'Actions']) if backups[value].init == "0": tab_mount.append([count + 1, backups[count].name, put_buttons([ dict(label='Mount', value='Mount', color='primary', disabled=True), dict(label='UMount', value='UMount', color='primary', disabled=True), dict(label='Restore', value='Restore', color='primary', disabled=True), ] , onclick=partial(actions, count + 1)) ]) else: tab_mount.append([count + 1, backups[count].name, put_buttons([ dict(label='Mount', value='Mount', color='primary'), dict(label='UMount', value='UMount', color='primary'), dict(label='Restore', value='Restore', color='primary'), ], onclick=partial(actions, count + 1)) ])Ruff - Linting
-
An extremely fast Python linter, written in Rust.
Den habe ich mal eben in meiner IDE PyCharm ausprobiert. Der ist wirklich so schnell, wie er behauptet.
Astra Kernel :verified: (@AstraKernel@infosec.exchange)
🦀 🐍 An extremely fast Python linter,written in Rust https://beta.ruff.rs/docs/ 🐍 Installable via pip 📦 Built-in caching, to avoid re-analyzing unchanged files 🔧 Autofix support, for automatic error correction (e.g., automatically remove unused imports) 🤝 Python 3.11 compatibility ⚖️ Near-parity with the built-in Flake8 rule set 🔌 Native re-implementations of dozens of Flake8 plugins, like flake8-bugbear ⌨️ First-party editor integrations for VS Code and more #rustlang #python
Infosec Exchange (infosec.exchange)
Bildquelle: https://beta.ruff.rs/docs/