mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Added util.make_repr() function; added corresponding unit tests
This commit is contained in:
@@ -137,3 +137,12 @@ class LogFormatter(logging.Formatter):
|
||||
Log formatter that uses UTC for all timestamps.
|
||||
"""
|
||||
converter = time.gmtime
|
||||
|
||||
|
||||
def make_repr(name, *args, **kw):
|
||||
"""
|
||||
Construct a standard representation of a class instance.
|
||||
"""
|
||||
args = [repr(a) for a in args]
|
||||
kw = ['%s=%r' % (k, kw[k]) for k in sorted(kw)]
|
||||
return '%s(%s)' % (name, ', '.join(args + kw))
|
||||
|
||||
Reference in New Issue
Block a user