mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-26 11:30:23 +00:00
Fix HTML view with unicode
This commit is contained in:
parent
186e89cd87
commit
7e6b4fa4d0
@ -23,6 +23,7 @@ import confluent.config.configmanager as cfm
|
||||
import confluent.config.conf as cfgfile
|
||||
from copy import deepcopy
|
||||
from datetime import datetime
|
||||
import confluent.util as util
|
||||
import json
|
||||
|
||||
try:
|
||||
@ -59,7 +60,9 @@ def _htmlify_structure(indict):
|
||||
if isinstance(indict, dict):
|
||||
for key in sorted(indict):
|
||||
ret += "<li>{0}: ".format(key)
|
||||
if type(indict[key]) in (bytes, unicode, float, int):
|
||||
if type(indict[key]) in (bytes, unicode):
|
||||
ret += util.stringify(indict[key])
|
||||
if type(indict[key]) in (float, int):
|
||||
ret += str(indict[key])
|
||||
elif isinstance(indict[key], datetime):
|
||||
ret += indict[key].strftime('%Y-%m-%dT%H:%M:%S')
|
||||
|
Loading…
Reference in New Issue
Block a user