summaryrefslogtreecommitdiff
path: root/poezio/theming.py
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2020-08-14 22:12:16 +0200
committerMaxime “pep” Buquet <pep@bouah.net>2020-08-14 22:12:26 +0200
commit03ef9c8d547872ae7aa87ecec4779bca49309225 (patch)
tree547dca2f342f7f102ec1f6e2d20776ce78bc1974 /poezio/theming.py
parent96f3bd72ac2704534388d993f644ec55abdf31b2 (diff)
downloadpoezio-03ef9c8d547872ae7aa87ecec4779bca49309225.tar.gz
poezio-03ef9c8d547872ae7aa87ecec4779bca49309225.tar.bz2
poezio-03ef9c8d547872ae7aa87ecec4779bca49309225.tar.xz
poezio-03ef9c8d547872ae7aa87ecec4779bca49309225.zip
move date and time SHORT_FORMAT and LONG_FORMAT to the theme
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
Diffstat (limited to 'poezio/theming.py')
-rwxr-xr-xpoezio/theming.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/poezio/theming.py b/poezio/theming.py
index 6f1d8226..7752fe15 100755
--- a/poezio/theming.py
+++ b/poezio/theming.py
@@ -78,6 +78,7 @@ from typing import Dict, List, Union, Tuple, Optional
from pathlib import Path
from os import path
from poezio import colors, xdg
+from datetime import datetime
from importlib import machinery
finder = machinery.PathFinder()
@@ -143,6 +144,14 @@ class Theme:
return sub_mapping[sub] if sub == keep else ''
return sub_mapping.get(sub, '')
+ # Short date format (only show time)
+ SHORT_TIME_FORMAT = '%H:%M:%S'
+ SHORT_TIME_FORMAT_LENGTH = len(datetime.now().strftime(SHORT_TIME_FORMAT))
+
+ # Long date format (show date and time)
+ LONG_TIME_FORMAT = '%Y-%m-%d %H:%M:%S'
+ LONG_TIME_FORMAT_LENGTH = len(datetime.now().strftime(LONG_TIME_FORMAT))
+
# Message text color
COLOR_NORMAL_TEXT = (-1, -1)
COLOR_INFORMATION_TEXT = (5, -1) # TODO