mapres 2.4a9__tar.gz → 2.4a10__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.4a9/src/mapres.egg-info → mapres-2.4a10}/PKG-INFO +1 -1
- {mapres-2.4a9 → mapres-2.4a10}/pyproject.toml +1 -1
- {mapres-2.4a9 → mapres-2.4a10}/src/mapres/datamap.py +7 -7
- {mapres-2.4a9 → mapres-2.4a10/src/mapres.egg-info}/PKG-INFO +1 -1
- {mapres-2.4a9 → mapres-2.4a10}/LICENSE +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/README.md +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/setup.cfg +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/src/mapres/__init__.py +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/src/mapres/cache.py +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/src/mapres/exceptions.py +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/src/mapres/layers.py +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/src/mapres/maps/__init__.py +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/src/mapres/maps/color.py +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/src/mapres/maps/time.py +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/src/mapres/resolver.py +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/src/mapres.egg-info/SOURCES.txt +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/src/mapres.egg-info/dependency_links.txt +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/src/mapres.egg-info/requires.txt +0 -0
- {mapres-2.4a9 → mapres-2.4a10}/src/mapres.egg-info/top_level.txt +0 -0
|
@@ -52,12 +52,8 @@ def datamap(_cls=None, *, syntax=syntax.double_braces, mode=None):
|
|
|
52
52
|
if rules_obj is not None:
|
|
53
53
|
setattr(cls, 'rules', rules_obj)
|
|
54
54
|
return dataclass(frozen=False)(cls)
|
|
55
|
-
|
|
56
|
-
# direct decorator: @datamap(...)
|
|
57
55
|
if _cls is not None:
|
|
58
56
|
return wrap(_cls)
|
|
59
|
-
|
|
60
|
-
# factory: @datamap(...)
|
|
61
57
|
return wrap
|
|
62
58
|
|
|
63
59
|
|
|
@@ -66,13 +62,17 @@ class _SyntaxFactory:
|
|
|
66
62
|
def __init__(self, syntax_value):
|
|
67
63
|
self._syntax = syntax_value
|
|
68
64
|
|
|
69
|
-
def __call__(self, **kwargs):
|
|
70
|
-
#
|
|
65
|
+
def __call__(self, _cls=None, **kwargs):
|
|
66
|
+
# Case 1: bare decorator: @datamap.colons
|
|
67
|
+
if _cls is not None and isinstance(_cls, type):
|
|
68
|
+
return datamap(_cls, syntax=self._syntax)
|
|
69
|
+
|
|
70
|
+
# Case 2: decorator with args: @datamap.colons(mode='config')
|
|
71
71
|
return datamap(syntax=self._syntax, **kwargs)
|
|
72
72
|
|
|
73
73
|
@property
|
|
74
74
|
def config(self):
|
|
75
|
-
#
|
|
75
|
+
# Case 3: @datamap.colons.config
|
|
76
76
|
return datamap(syntax=self._syntax, mode='config')
|
|
77
77
|
|
|
78
78
|
|
|
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
|
|
File without changes
|