plain 0.46.0__py3-none-any.whl → 0.47.0__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.
- plain/runtime/__init__.py +15 -0
- {plain-0.46.0.dist-info → plain-0.47.0.dist-info}/METADATA +1 -1
- {plain-0.46.0.dist-info → plain-0.47.0.dist-info}/RECORD +6 -6
- {plain-0.46.0.dist-info → plain-0.47.0.dist-info}/WHEEL +0 -0
- {plain-0.46.0.dist-info → plain-0.47.0.dist-info}/entry_points.txt +0 -0
- {plain-0.46.0.dist-info → plain-0.47.0.dist-info}/licenses/LICENSE +0 -0
plain/runtime/__init__.py
CHANGED
@@ -18,16 +18,31 @@ PLAIN_TEMP_PATH = Path.cwd() / ".plain"
|
|
18
18
|
# from plain.runtime import settings
|
19
19
|
settings = Settings()
|
20
20
|
|
21
|
+
_is_setup_complete = False
|
22
|
+
|
21
23
|
|
22
24
|
class AppPathNotFound(RuntimeError):
|
23
25
|
pass
|
24
26
|
|
25
27
|
|
28
|
+
class SetupError(RuntimeError):
|
29
|
+
pass
|
30
|
+
|
31
|
+
|
26
32
|
def setup():
|
27
33
|
"""
|
28
34
|
Configure the settings (this happens as a side effect of accessing the
|
29
35
|
first setting), configure logging and populate the app registry.
|
30
36
|
"""
|
37
|
+
global _is_setup_complete
|
38
|
+
|
39
|
+
if _is_setup_complete:
|
40
|
+
raise SetupError(
|
41
|
+
"Plain runtime is already set up. You can only call `setup()` once."
|
42
|
+
)
|
43
|
+
else:
|
44
|
+
# Make sure we don't call setup() again
|
45
|
+
_is_setup_complete = True
|
31
46
|
|
32
47
|
# Packages can hook into the setup process through an entrypoint.
|
33
48
|
for entry_point in entry_points().select(group="plain.setup"):
|
@@ -82,7 +82,7 @@ plain/preflight/registry.py,sha256=wHLq6LSMkKunkxElBmNwzMzQx3tc6OGYeKyOOi0tuyQ,2
|
|
82
82
|
plain/preflight/security.py,sha256=oxUZBp2M0bpBfUoLYepIxoex2Y90nyjlrL8XU8UTHYY,2438
|
83
83
|
plain/preflight/urls.py,sha256=cQ-WnFa_5oztpKdtwhuIGb7pXEml__bHsjs1SWO2YNI,1468
|
84
84
|
plain/runtime/README.md,sha256=S_FIOmSq8LkVQHh9Xm6s3EJWKTVdlSr5A_bNXgh02X8,4740
|
85
|
-
plain/runtime/__init__.py,sha256=
|
85
|
+
plain/runtime/__init__.py,sha256=8GtvKROf3HUCtneDYXTbEioPcCtwnV76dP57n2PnjuE,2343
|
86
86
|
plain/runtime/global_settings.py,sha256=MpJ6vtBMO2EYALaKXrtgcGoxLh9Y549zwwErC5D5K7I,5343
|
87
87
|
plain/runtime/user_settings.py,sha256=OzMiEkE6ZQ50nxd1WIqirXPiNuMAQULklYHEzgzLWgA,11027
|
88
88
|
plain/signals/README.md,sha256=FInfJXdVQkb7u93PvD8XgPbz_f6m0l2xIu_4PyttV1E,234
|
@@ -146,8 +146,8 @@ plain/views/forms.py,sha256=ESZOXuo6IeYixp1RZvPb94KplkowRiwO2eGJCM6zJI0,2400
|
|
146
146
|
plain/views/objects.py,sha256=GGbcfg_9fPZ-PiaBwIHG2e__8GfWDR7JQtQ15wTyiHg,5970
|
147
147
|
plain/views/redirect.py,sha256=daq2cQIkdDF78bt43sjuZxRAyJm_t_SKw6tyPmiXPIc,1985
|
148
148
|
plain/views/templates.py,sha256=SU1fO9gVMp-gEQHYeFplxvmgeMyrLgT8MJ12WNVmQC8,2085
|
149
|
-
plain-0.
|
150
|
-
plain-0.
|
151
|
-
plain-0.
|
152
|
-
plain-0.
|
153
|
-
plain-0.
|
149
|
+
plain-0.47.0.dist-info/METADATA,sha256=1pZQsM230re8YuNsP-4sMkVswn-9OrSRzm0A7QxhVA8,4297
|
150
|
+
plain-0.47.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
151
|
+
plain-0.47.0.dist-info/entry_points.txt,sha256=1Ys2lsSeMepD1vz8RSrJopna0RQfUd951vYvCRsvl6A,45
|
152
|
+
plain-0.47.0.dist-info/licenses/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
|
153
|
+
plain-0.47.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|