diff options
author | Maxime “pep” Buquet <pep@bouah.net> | 2019-08-02 17:40:34 +0200 |
---|---|---|
committer | Maxime “pep” Buquet <pep@bouah.net> | 2019-08-02 17:40:34 +0200 |
commit | d8774d83907a031664b4956b45c2cbe8e6589d5d (patch) | |
tree | 91e0415a9d8b5ddde63e4bdb1f21158fbe75023d | |
parent | d43c8cf8788600a23a7cca6338200b007b7d854a (diff) | |
download | poezio-d8774d83907a031664b4956b45c2cbe8e6589d5d.tar.gz poezio-d8774d83907a031664b4956b45c2cbe8e6589d5d.tar.bz2 poezio-d8774d83907a031664b4956b45c2cbe8e6589d5d.tar.xz poezio-d8774d83907a031664b4956b45c2cbe8e6589d5d.zip |
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>
-rw-r--r-- | poezio/text_buffer.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/poezio/text_buffer.py b/poezio/text_buffer.py index f942c48e..bf0ac966 100644 --- a/poezio/text_buffer.py +++ b/poezio/text_buffer.py @@ -47,16 +47,12 @@ class Message: txt[4:]) else: me = False + str_time = time.strftime("%H:%M:%S") if history: txt = txt.replace( '\x19o', '\x19o\x19%s}' % dump_tuple(get_theme().COLOR_LOG_MSG)) 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.nick_color = nick_color |