Files
gists/config/visidata/plugins/__init__.py
tobias 84d912ac0a visidata: add IOC types with cached, throttled lookups
Centralize provider caching and rate-limit handling, then add Domain/URL/Hash IOC types and safer VT/IPInfo key resolution so lookups stay reliable on free-tier APIs.
2026-02-21 23:20:42 +01:00

29 lines
824 B
Python

"""
Local VisiData plugins.
VisiData (v3.3) imports the top-level `plugins` package early (before config.py)
when `options.imports` contains "plugins" (default). Import submodules here so
their commands/types are registered on startup.
"""
# Keep imports resilient: a missing optional plugin shouldn't prevent VisiData from starting.
for _mod in (
"hidecol",
"iptype",
"ioc",
):
try:
__import__(f"{__name__}.{_mod}")
except ModuleNotFoundError:
# Optional/missing plugin file.
continue
except Exception as e:
# Don't silently swallow unexpected import errors; surface them.
try:
from visidata import vd
vd.warning(f"plugin import failed: plugins.{_mod}")
vd.exceptionCaught(e)
except Exception:
raise