mirror of
https://github.com/craigerl/aprsd.git
synced 2025-07-29 03:42:29 -04:00
Some cleanup with list plugins
This commit is contained in:
parent
df14eb8f28
commit
5274c5dc56
@ -91,19 +91,17 @@ def _get_installed_aprsd_items():
|
|||||||
plugins = {}
|
plugins = {}
|
||||||
extensions = {}
|
extensions = {}
|
||||||
for finder, name, ispkg in pkgutil.iter_modules():
|
for finder, name, ispkg in pkgutil.iter_modules():
|
||||||
if name.startswith("aprsd_"):
|
if ispkg and name.startswith("aprsd_"):
|
||||||
print(f"Found aprsd_ module: {name}")
|
module = importlib.import_module(name)
|
||||||
if ispkg:
|
pkgs = walk_package(module)
|
||||||
module = importlib.import_module(name)
|
for pkg in pkgs:
|
||||||
pkgs = walk_package(module)
|
pkg_info = get_module_info(
|
||||||
for pkg in pkgs:
|
module.__name__, pkg.name, module.__path__[0]
|
||||||
pkg_info = get_module_info(
|
)
|
||||||
module.__name__, pkg.name, module.__path__[0]
|
if "plugin" in name:
|
||||||
)
|
plugins[name] = pkg_info
|
||||||
if "plugin" in name:
|
elif "extension" in name:
|
||||||
plugins[name] = pkg_info
|
extensions[name] = pkg_info
|
||||||
elif "extension" in name:
|
|
||||||
extensions[name] = pkg_info
|
|
||||||
return plugins, extensions
|
return plugins, extensions
|
||||||
|
|
||||||
|
|
||||||
|
@ -113,6 +113,7 @@ class ListenStatsThread(APRSDThread):
|
|||||||
stats_json = collector.Collector().collect()
|
stats_json = collector.Collector().collect()
|
||||||
stats = stats_json["PacketList"]
|
stats = stats_json["PacketList"]
|
||||||
total_rx = stats["rx"]
|
total_rx = stats["rx"]
|
||||||
|
packet_count = len(stats["packets"])
|
||||||
rx_delta = total_rx - self._last_total_rx
|
rx_delta = total_rx - self._last_total_rx
|
||||||
rate = rx_delta / 10
|
rate = rx_delta / 10
|
||||||
|
|
||||||
@ -120,7 +121,8 @@ class ListenStatsThread(APRSDThread):
|
|||||||
LOGU.opt(colors=True).info(
|
LOGU.opt(colors=True).info(
|
||||||
f"<green>RX Rate: {rate} pps</green> "
|
f"<green>RX Rate: {rate} pps</green> "
|
||||||
f"<yellow>Total RX: {total_rx}</yellow> "
|
f"<yellow>Total RX: {total_rx}</yellow> "
|
||||||
f"<red>RX Last 10 secs: {rx_delta}</red>",
|
f"<red>RX Last 10 secs: {rx_delta}</red> "
|
||||||
|
f"<white>Packets in PacketList: {packet_count}</white>",
|
||||||
)
|
)
|
||||||
self._last_total_rx = total_rx
|
self._last_total_rx = total_rx
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user