INNER CODE UNIT · Python
signal_handler
atenreiro/opensquat · opensquat/cli.py:23
def signal_handler(sig, frame):
"""Function to catch CTR+C and terminate."""
print("\n[*] openSquat is terminating...\n")
exit(0)
def _serialize_domain(d):
"""
Serialize a LookalikeDomain into a JSON-friendly dict.
Optional fields (tld, date, unicode) are omitted when they're None so
the output stays compact. `idn` is always emitted, even when False,
because the boolean presence is informative: it tells consumers the
tool checked and the domain is not a homograph (vs. not having the
information at all, which is what community/feed modes look like).
"""
out = {"domain": d.domain}
if d.tld is not None: