Small corrections to list_interfaces(). Also make pyproject.toml usable.

This commit is contained in:
Sebastian Lenzlinger 2024-06-12 16:51:17 +02:00
parent 5196c2e129
commit f22b06ad14
3 changed files with 7 additions and 7 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ __pycache__
2024-bsc-sebastian-lenzlinger.iml
logs/
requirements.txt
*.egg-info/

View File

@ -20,7 +20,7 @@ def list_interfaces() -> str:
ensure_installed()
try:
result = subprocess.run(['tcpdump', '--list-interfaces'], capture_output=True, text=True, check=True)
return result.stdout
print(result.stdout)
except subprocess.CalledProcessError as e:
print(f'Failed to list interfaces: {e}')
return ''

View File

@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "wheel"]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
[project]
@ -7,11 +7,10 @@ name = 'iottb'
version = '0.1.0'
authors = [{name = "Sebastian Lenzlinger", email = "sebastian.lenzlinger@unibas.ch"}]
description = "Automation Tool for Capturing Network packets of IoT devices."
license = {file = "LICENSE"}
dependencies = [
# List your dependencies here, e.g., "numpy", "pandas>=1.0"
]
include-package-data = true
requires-python = ">=3.8"
[tool.setuptools]
packages = ["iottb"]
[project.scripts]
iottb = "iottb.__main__:main"