text_buffer: Prevent using str as a datetime object
Cleanup a bit how `str_time` is assigned. Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
d43c8cf878
commit
d8774d8390
1 changed files with 1 additions and 5 deletions
|
@ -47,16 +47,12 @@ class Message:
|
||||||
txt[4:])
|
txt[4:])
|
||||||
else:
|
else:
|
||||||
me = False
|
me = False
|
||||||
|
str_time = time.strftime("%H:%M:%S")
|
||||||
if history:
|
if history:
|
||||||
txt = txt.replace(
|
txt = txt.replace(
|
||||||
'\x19o',
|
'\x19o',
|
||||||
'\x19o\x19%s}' % dump_tuple(get_theme().COLOR_LOG_MSG))
|
'\x19o\x19%s}' % dump_tuple(get_theme().COLOR_LOG_MSG))
|
||||||
str_time = time.strftime("%Y-%m-%d %H:%M:%S")
|
str_time = time.strftime("%Y-%m-%d %H:%M:%S")
|
||||||
else:
|
|
||||||
if str_time is None:
|
|
||||||
str_time = time.strftime("%H:%M:%S")
|
|
||||||
else:
|
|
||||||
str_time = str_time.strftime("%Y-%m-%d %H:%M:%S")
|
|
||||||
|
|
||||||
self.txt = txt.replace('\t', ' ') + '\x19o'
|
self.txt = txt.replace('\t', ' ') + '\x19o'
|
||||||
self.nick_color = nick_color
|
self.nick_color = nick_color
|
||||||
|
|
Loading…
Reference in a new issue