jwutils: Move to jwutils -> jw.util

Move all implementation source code from the jwutils module to
jw.util. For compatibility with existing Python modules, keep a thin,
autogenerated compatibility shim under jwutils.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-06-10 07:22:46 +02:00 • committed by janware DevOps
commit a2684dd601
Signed by: DevOps
SSH key fingerprint: SHA256:cZiw7ExG5q3KAVm7Jse3rGITowu0VjgUgNMPbifmY8g

View file

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
from datetime import datetime
from .log import *
class StopWatch: # export
def __init__(self, name=''):
self.__start = datetime.now()
self.__last = self.__start
self.name = name
def reset(self):
self.__start = datetime.now()
def logDelta(self, prio, *args, **kwargs):
now = datetime.now()
if args is not None:
msg = ' '.join(args)
else:
msg = '------------------ '
caller = kwargs['caller'] if 'caller' in kwargs.keys() else get_caller_pos(1)
slog(prio, '{} {} {}'.format(self.name, str(now - self.__last), msg), caller=caller)
self.__last = now