From 03ef9c8d547872ae7aa87ecec4779bca49309225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Fri, 14 Aug 2020 22:12:16 +0200 Subject: move date and time SHORT_FORMAT and LONG_FORMAT to the theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/theming.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'poezio/theming.py') 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 -- cgit v1.2.3