fresco 3.3.3__py3-none-any.whl → 3.3.4__py3-none-any.whl
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.
- fresco/__init__.py +1 -1
- fresco/options.py +11 -3
- fresco/routing.py +1 -1
- fresco/tests/test_options.py +8 -3
- {fresco-3.3.3.dist-info → fresco-3.3.4.dist-info}/METADATA +1 -1
- {fresco-3.3.3.dist-info → fresco-3.3.4.dist-info}/RECORD +9 -9
- {fresco-3.3.3.dist-info → fresco-3.3.4.dist-info}/WHEEL +1 -1
- {fresco-3.3.3.dist-info → fresco-3.3.4.dist-info}/LICENSE.txt +0 -0
- {fresco-3.3.3.dist-info → fresco-3.3.4.dist-info}/top_level.txt +0 -0
fresco/__init__.py
CHANGED
fresco/options.py
CHANGED
|
@@ -127,6 +127,12 @@ class Options(dict):
|
|
|
127
127
|
Where filename contain multiple tags, all tags must match for the file
|
|
128
128
|
to be loaded.
|
|
129
129
|
|
|
130
|
+
Files are processed in the order that tags are specified in the
|
|
131
|
+
``tags`` parameter, and then in lexicographical order.
|
|
132
|
+
For example, calling ``options.load(..., tags=["dev", "local"])`` would
|
|
133
|
+
cause a file named "settings.dev" to be loaded before one named
|
|
134
|
+
"settings.local".
|
|
135
|
+
|
|
130
136
|
Tag names may contain the names of environment variable surrounded by
|
|
131
137
|
braces, for example ``{USER}``. These will be substituted for the
|
|
132
138
|
environment variable's value, with any dots or path separators replaced
|
|
@@ -210,9 +216,11 @@ class Options(dict):
|
|
|
210
216
|
ts[1]
|
|
211
217
|
for ts in sorted(
|
|
212
218
|
tagged_sources,
|
|
213
|
-
key=
|
|
214
|
-
|
|
215
|
-
|
|
219
|
+
key=(
|
|
220
|
+
lambda ts: ([], ts[1])
|
|
221
|
+
if len(ts[0]) == 0
|
|
222
|
+
else (sorted(tags.index(t) for t in ts[0]), ts[1])
|
|
223
|
+
)
|
|
216
224
|
)
|
|
217
225
|
]
|
|
218
226
|
else:
|
fresco/routing.py
CHANGED
|
@@ -1386,7 +1386,7 @@ class RouteCollection(MutableSequence):
|
|
|
1386
1386
|
|
|
1387
1387
|
def _get_routes(
|
|
1388
1388
|
self, key: Tuple[t.Optional[str], str]
|
|
1389
|
-
) -> t.Sequence[t.Tuple[Route,
|
|
1389
|
+
) -> t.Sequence[t.Tuple[Route, PathMatch]]:
|
|
1390
1390
|
method, path = key
|
|
1391
1391
|
routes = ((r, r.match(path, method)) for r in self.__routes__)
|
|
1392
1392
|
return [(r, t) for (r, t) in routes if t is not None]
|
fresco/tests/test_options.py
CHANGED
|
@@ -216,10 +216,15 @@ class TestLoadOptions:
|
|
|
216
216
|
def test_it_loads_in_tag_order(self, tmpdir):
|
|
217
217
|
with self.check_loadoptions(
|
|
218
218
|
tmpdir,
|
|
219
|
-
{
|
|
219
|
+
{
|
|
220
|
+
"a": "a = 0",
|
|
221
|
+
"a.dev.txt": "a = ${a}-1",
|
|
222
|
+
"a.local.txt": "a = ${a}-2",
|
|
223
|
+
"b.dev.txt": "a = ${a}-3",
|
|
224
|
+
},
|
|
220
225
|
) as loadopts:
|
|
221
|
-
assert loadopts("*", ["dev", "local"]) == {"a": "
|
|
222
|
-
assert loadopts("*", ["local", "dev"]) == {"a": "
|
|
226
|
+
assert loadopts("*", ["dev", "local"]) == {"a": "0-1-3-2"}
|
|
227
|
+
assert loadopts("*", ["local", "dev"]) == {"a": "0-2-1-3"}
|
|
223
228
|
|
|
224
229
|
def test_it_loads_from_os_environ(self, tmpdir):
|
|
225
230
|
with setenv(a="2"):
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
fresco/__init__.py,sha256=
|
|
1
|
+
fresco/__init__.py,sha256=DkBKfTdD88kXZYGi5Pv686Es1twTgZ4fVO3mA2nf0GQ,3520
|
|
2
2
|
fresco/cookie.py,sha256=Qnx8yOjU4LUJ1fqi7YvqbhAA01rCsclJGl_fxI68slw,7055
|
|
3
3
|
fresco/core.py,sha256=mwYR6UP0zRSjcFlNZf51-otX9EcmvgjEZ7GDVQoQexg,26615
|
|
4
4
|
fresco/decorators.py,sha256=84NUpRJ-M7GK6wDl42bmCRSvgoWzCsy1huyvGnSAPPw,3232
|
|
5
5
|
fresco/exceptions.py,sha256=KE-LoYUGnho6KltzkU6cnm9vUiUhAiDIjPqn5ba-YCA,4410
|
|
6
6
|
fresco/middleware.py,sha256=uCAuOtBnvaVBJGrQa8ecvLkSZ6aSKmWaJqxB8Rv4SsQ,4173
|
|
7
7
|
fresco/multidict.py,sha256=0CaNNIcFnZ1hLk3NExhNvjc_BtK4zVB26L9gP_7MeNM,13362
|
|
8
|
-
fresco/options.py,sha256=
|
|
8
|
+
fresco/options.py,sha256=0RzwO1eyCUC70GxKFnCHNKDyZwsKc9Q-AmtlMAnfZ-Q,14004
|
|
9
9
|
fresco/request.py,sha256=dC7pMg-4Kxa6PcqaaWFL4JviANQotuBjoKwlxZYywRY,27048
|
|
10
10
|
fresco/requestcontext.py,sha256=P-SkKJkKLYVqNiR2zwooRROnSnE2VMj2P2-eD5DW5Qg,3504
|
|
11
11
|
fresco/response.py,sha256=ADKHbtAGyhwtaUJxB7m_1nqVdZRKUryebmG4FDUjZVY,37072
|
|
12
12
|
fresco/routeargs.py,sha256=dxNlqbQ1FrgIY6OCFzcEMdZ0OVyjlMQdQGLmUJgdPYU,10176
|
|
13
|
-
fresco/routing.py,sha256=
|
|
13
|
+
fresco/routing.py,sha256=kTFqJ9Nn9cOHlul-lHqKDurBwqlEO4fg8tertb1jkoI,58709
|
|
14
14
|
fresco/static.py,sha256=9SKQ3P1YFTP45Qiic-ycvkpKRvqIURp1XSzPazTmYLI,2513
|
|
15
15
|
fresco/subrequests.py,sha256=wFJWLuhVAcei5imYc5NBSCBaHBEm-X4_XswPtK3O4Zw,11081
|
|
16
16
|
fresco/types.py,sha256=UHITRMDoS90s2zV2wNpqLFhRWESfaBAMuQnL4c21mqY,106
|
|
@@ -23,7 +23,7 @@ fresco/tests/test_decorators.py,sha256=VFXHo1gm2jldQXeaEF3NNo5fnpdJ-LXc8-vNymPJK
|
|
|
23
23
|
fresco/tests/test_exceptions.py,sha256=R0Tn86m33iTKecZ69TgH4CqY9XSFP0FsLMH10O5Jth8,973
|
|
24
24
|
fresco/tests/test_middleware.py,sha256=D_sWfX-w3bhItOm54nB_cuYPGoWopISvZCFIuMX68cU,3137
|
|
25
25
|
fresco/tests/test_multidict.py,sha256=uDwDYII0dvVxaEyDO85zRTWlIWw3LO3StzYemJVm0E0,7565
|
|
26
|
-
fresco/tests/test_options.py,sha256=
|
|
26
|
+
fresco/tests/test_options.py,sha256=Zx1tLVLeok8tO3dWua2PyTPZgeWbXFMXtN3FnorBmC8,10998
|
|
27
27
|
fresco/tests/test_request.py,sha256=hoANrergrohlAeTbQufDMfIbvYURsPyPjCxOVKz7bVo,16389
|
|
28
28
|
fresco/tests/test_requestcontext.py,sha256=t8hm-lzIk85ryb3sdlpVoPQyLDWpCjB86dg8nVG1yRw,3115
|
|
29
29
|
fresco/tests/test_response.py,sha256=MrhHIDg81pJlTeEcn2rGtU-i59s1KzEccF81u4Up6xs,8934
|
|
@@ -50,8 +50,8 @@ fresco/util/security.py,sha256=nXEdoCak_2c4OA1L1wGwhZygS22s2fzwR0Kp-DdwKZg,1058
|
|
|
50
50
|
fresco/util/textproc.py,sha256=e5jLTofKCqdm6_Fy8XOyR43AJr5APtL59Kd8cNA9PrQ,2309
|
|
51
51
|
fresco/util/urls.py,sha256=aaVovLyXNlVoGviiLN94ImqXf-LTQs_xooEIyi3LBc4,9195
|
|
52
52
|
fresco/util/wsgi.py,sha256=2cr2b92RpvPSgS_P46X2mlYepoFg9Qji-V-fzxpSNzw,12971
|
|
53
|
-
fresco-3.3.
|
|
54
|
-
fresco-3.3.
|
|
55
|
-
fresco-3.3.
|
|
56
|
-
fresco-3.3.
|
|
57
|
-
fresco-3.3.
|
|
53
|
+
fresco-3.3.4.dist-info/LICENSE.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
54
|
+
fresco-3.3.4.dist-info/METADATA,sha256=v9NcXIhYp5MqENOecCV7XIsFrg7sC9GdRmIHuS912HI,1549
|
|
55
|
+
fresco-3.3.4.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
56
|
+
fresco-3.3.4.dist-info/top_level.txt,sha256=p_1aMce5Shjq9fIfdbB-aN8wCDhjF_iYnn98bUebbII,7
|
|
57
|
+
fresco-3.3.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|