mirror of
ssh://devgit.janware.com/janware/proj/jw-python
synced 2026-06-18 01:16:38 +02:00
Changes in Python 3 that made the code choke:
o basestring is merged into str o print() needs parentesis o Class inheritance syntax changed o Abstract baseclass (ABCMeta) syntax changed o map.iteritems() is replaced by map.items() o Inconsistent use of tabs and spaces are no longer tolerated
Signed-off-by: Jan Lindemann <jan@janware.com>
21 lines
575 B
Python
21 lines
575 B
Python
from __future__ import print_function
|
|
import jwutils.log
|
|
|
|
class Object(object): # export
|
|
|
|
def __init__():
|
|
self.log_level = jwutils.log.level
|
|
|
|
def log(self, prio, *args):
|
|
if self.log_level == jwutils.log.level:
|
|
jwutils.log.slog(prio, args)
|
|
return
|
|
if prio <= self.log_level:
|
|
msg = ""
|
|
for count, thing in enumerate(args):
|
|
msg += ' ' + str(*thing)
|
|
if len(msg):
|
|
print(msg[1:])
|
|
|
|
def debug(self, *args):
|
|
jwutils.log.slog(jwutils.log.DEBUG, args)
|