import pytz
import sys
+# This module is commonly used by others in here and should avoid
+# taking any unnecessary dependencies back on them.
import argparse_utils
import config
-import string_utils as su
-import thread_utils as tu
cfg = config.add_commandline_args(
f'Logging ({__file__})',
def tprint(*args, **kwargs) -> None:
if config.config['logging_debug_threads']:
- print(f'{tu.current_thread_id()}', end="")
+ from thread_utils import current_thread_id
+ print(f'{current_thread_id()}', end="")
print(*args, **kwargs)
else:
pass
self.destination_bitv = destination_bitv
def print(self, *args, **kwargs):
+ from string_utils import sprintf, strip_escape_sequences
end = kwargs.pop("end", None)
if end is not None:
if not isinstance(end, str):
raise TypeError("sep must be None or a string")
if kwargs:
raise TypeError("invalid keyword arguments to print()")
- buf = su.sprintf(*args, end="", sep=sep)
+ buf = sprintf(*args, end="", sep=sep)
if sep is None:
sep = " "
if end is None:
if self.destination_bitv & self.FILENAME and self.f is not None:
self.f.write(buf.encode('utf-8'))
self.f.flush()
- buf = su.strip_escape_sequences(buf)
+ buf = strip_escape_sequences(buf)
if self.logger is not None:
if self.destination_bitv & self.LOG_DEBUG:
self.logger.debug(buf)