From 91ab00eec63a0e6d1d8d12ce89ba6e4aaca8e6a1 Mon Sep 17 00:00:00 2001 From: Davte Date: Sat, 11 Apr 2020 16:12:13 +0200 Subject: [PATCH] Weekdays multilanguage dictionary --- davtelepot/__init__.py | 2 +- davtelepot/utilities.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/davtelepot/__init__.py b/davtelepot/__init__.py index f0fff4f..3fa5e64 100644 --- a/davtelepot/__init__.py +++ b/davtelepot/__init__.py @@ -14,7 +14,7 @@ __author__ = "Davide Testa" __email__ = "davide@davte.it" __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"] __license__ = "GNU General Public License v3.0" -__version__ = "2.4.18" +__version__ = "2.4.19" __maintainer__ = "Davide Testa" __contact__ = "t.me/davte" diff --git a/davtelepot/utilities.py b/davtelepot/utilities.py index a8bfd8a..b27f898 100644 --- a/davtelepot/utilities.py +++ b/davtelepot/utilities.py @@ -23,6 +23,37 @@ from aiohttp import web from bs4 import BeautifulSoup +weekdays = collections.OrderedDict() +weekdays[0] = { + 'en': "Sunday", + 'it': "Domenica", +} +weekdays[1] = { + 'en': "Monday", + 'it': "Lunedì", +} +weekdays[2] = { + 'en': "Tuesday", + 'it': "Martedì", +} +weekdays[3] = { + 'en': "Wednesday", + 'it': "Mercoledì", +} +weekdays[4] = { + 'en': "Thursday", + 'it': "Giovedì", +} +weekdays[5] = { + 'en': "Friday", + 'it': "Venerdì", +} +weekdays[6] = { + 'en': "Saturday", + 'it': "Sabato", +} + + def sumif(iterable, condition): """Sum all `iterable` items matching `condition`.""" return sum(