mapres 2.4.dev2__tar.gz → 2.4.dev4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mapres-2.4.dev2/src/mapres.egg-info → mapres-2.4.dev4}/PKG-INFO +1 -1
- {mapres-2.4.dev2 → mapres-2.4.dev4}/pyproject.toml +1 -1
- {mapres-2.4.dev2 → mapres-2.4.dev4}/src/mapres/datamap.py +1 -1
- {mapres-2.4.dev2 → mapres-2.4.dev4}/src/mapres/maps/time.py +25 -24
- {mapres-2.4.dev2 → mapres-2.4.dev4/src/mapres.egg-info}/PKG-INFO +1 -1
- {mapres-2.4.dev2 → mapres-2.4.dev4}/LICENSE +0 -0
- {mapres-2.4.dev2 → mapres-2.4.dev4}/README.md +0 -0
- {mapres-2.4.dev2 → mapres-2.4.dev4}/setup.cfg +0 -0
- {mapres-2.4.dev2 → mapres-2.4.dev4}/src/mapres/__init__.py +0 -0
- {mapres-2.4.dev2 → mapres-2.4.dev4}/src/mapres/cache.py +0 -0
- {mapres-2.4.dev2 → mapres-2.4.dev4}/src/mapres/exceptions.py +0 -0
- {mapres-2.4.dev2 → mapres-2.4.dev4}/src/mapres/layers.py +0 -0
- {mapres-2.4.dev2 → mapres-2.4.dev4}/src/mapres/maps/__init__.py +0 -0
- {mapres-2.4.dev2 → mapres-2.4.dev4}/src/mapres/maps/color.py +0 -0
- {mapres-2.4.dev2 → mapres-2.4.dev4}/src/mapres/resolver.py +0 -0
- {mapres-2.4.dev2 → mapres-2.4.dev4}/src/mapres.egg-info/SOURCES.txt +0 -0
- {mapres-2.4.dev2 → mapres-2.4.dev4}/src/mapres.egg-info/dependency_links.txt +0 -0
- {mapres-2.4.dev2 → mapres-2.4.dev4}/src/mapres.egg-info/requires.txt +0 -0
- {mapres-2.4.dev2 → mapres-2.4.dev4}/src/mapres.egg-info/top_level.txt +0 -0
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
from datetime import datetime
|
|
1
|
+
from datetime import datetime, timezone
|
|
2
2
|
from zoneinfo import ZoneInfo
|
|
3
3
|
from mapres.datamap import datamap, syntax
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
class TimeMap:
|
|
8
|
-
# default timezone
|
|
6
|
+
def safe_zoneinfo(tz: str):
|
|
9
7
|
try:
|
|
10
|
-
|
|
8
|
+
return ZoneInfo(tz)
|
|
11
9
|
except Exception:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
10
|
+
return timezone.utc
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@datamap(syntax=syntax.percents, mode='dynamic')
|
|
14
|
+
class TimeMap:
|
|
15
|
+
_default_tz = safe_zoneinfo("America/Chicago")
|
|
16
|
+
|
|
17
|
+
hh: str | None = None
|
|
18
|
+
h: str | None = None
|
|
19
|
+
h12: str | None = None
|
|
20
|
+
hh12: str | None = None
|
|
21
|
+
ampm: str | None = None
|
|
22
|
+
mm: str | None = None
|
|
23
|
+
m: str | None = None
|
|
24
|
+
ss: str | None = None
|
|
25
|
+
s: str | None = None
|
|
26
|
+
ms: str | None = None
|
|
27
|
+
YYYY: str | None = None
|
|
28
|
+
MM: str | None = None
|
|
29
|
+
DD: str | None = None
|
|
30
|
+
weekday: str | None = None
|
|
30
31
|
|
|
31
32
|
def __init__(self, tz: str | None = None):
|
|
32
|
-
self.TZ =
|
|
33
|
+
self.TZ = safe_zoneinfo(tz) if tz else self._default_tz
|
|
33
34
|
|
|
34
35
|
@property
|
|
35
36
|
def providers(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|