diff options
author | Malfurious <m@lfurio.us> | 2025-01-04 23:57:16 -0500 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2025-01-04 23:57:16 -0500 |
commit | 23c750d2edc712c4a37e0774049a1a0f9a966009 (patch) | |
tree | e16b9f6495776dccc2c8e39d29b66d28d94b3448 /sploit/util/log.py | |
parent | 640726aa11369d328c1cdfe00b4344b6a925729c (diff) | |
parent | 831fd7402cd357a79b76007471722a243ec60c8d (diff) | |
download | nsploit-23c750d2edc712c4a37e0774049a1a0f9a966009.tar.gz nsploit-23c750d2edc712c4a37e0774049a1a0f9a966009.zip |
Merge branch 'nsploit'
Rename fork to nsploit and touch up project files. We switch from
automatically obtaining version via git-describe to a static definition
in pyproject.toml, to support more install use-cases.
* nsploit:
Update pyproject file for nsploit
Don't rely on git for version information
main: Update ASCII banner for nsploit
Rename sploit package to nsploit
Diffstat (limited to 'sploit/util/log.py')
-rw-r--r-- | sploit/util/log.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/sploit/util/log.py b/sploit/util/log.py deleted file mode 100644 index 823b252..0000000 --- a/sploit/util/log.py +++ /dev/null @@ -1,32 +0,0 @@ -import codecs -import sys - -# https://docs.python.org/3/library/codecs.html#standard-encodings -ENCODING = None - -ERROR = 31 -WARNING = 33 -STATUS = 32 -NORMAL = 0 -ALT = 90 - -def enc_value(value, enc): - if type(value) is bytes: - if enc is not None: - value = codecs.encode(value, enc) - elif ENCODING is not None: - value = codecs.encode(value, ENCODING) - value = str(value)[2:-1] # strip b'' - return str(value) - -def generic_log(*values, sep, end, file, flush, enc, color): - string = sep.join([ enc_value(x, enc) for x in values ]) - print(f'\033[{color}m{string}\033[0m', end=end, file=file, flush=flush) - -# For library internal use -def ilog(*values, sep=' ', end='\n', file=sys.stderr, flush=True, enc=None, color=STATUS): - generic_log(*values, sep=sep, end=end, file=file, flush=flush, enc=enc, color=color) - -# For external use in user script (via print = elog) -def elog(*values, sep=' ', end='\n', file=sys.stdout, flush=True, enc=None, color=ALT): - generic_log(*values, sep=sep, end=end, file=file, flush=flush, enc=enc, color=color) |