arthexis 0.1.16__py3-none-any.whl → 0.1.28__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.
Potentially problematic release.
This version of arthexis might be problematic. Click here for more details.
- {arthexis-0.1.16.dist-info → arthexis-0.1.28.dist-info}/METADATA +95 -41
- arthexis-0.1.28.dist-info/RECORD +112 -0
- config/asgi.py +1 -15
- config/middleware.py +47 -1
- config/settings.py +21 -30
- config/settings_helpers.py +176 -1
- config/urls.py +69 -1
- core/admin.py +805 -473
- core/apps.py +6 -8
- core/auto_upgrade.py +19 -4
- core/backends.py +13 -3
- core/celery_utils.py +73 -0
- core/changelog.py +66 -5
- core/environment.py +4 -5
- core/models.py +1825 -218
- core/notifications.py +1 -1
- core/reference_utils.py +10 -11
- core/release.py +55 -7
- core/sigil_builder.py +2 -2
- core/sigil_resolver.py +1 -66
- core/system.py +285 -4
- core/tasks.py +439 -138
- core/test_system_info.py +43 -5
- core/tests.py +516 -18
- core/user_data.py +94 -21
- core/views.py +348 -186
- nodes/admin.py +904 -67
- nodes/apps.py +12 -1
- nodes/feature_checks.py +30 -0
- nodes/models.py +800 -127
- nodes/rfid_sync.py +1 -1
- nodes/tasks.py +98 -3
- nodes/tests.py +1381 -152
- nodes/urls.py +15 -1
- nodes/utils.py +51 -3
- nodes/views.py +1382 -152
- ocpp/admin.py +1970 -152
- ocpp/consumers.py +839 -34
- ocpp/models.py +968 -17
- ocpp/network.py +398 -0
- ocpp/store.py +411 -43
- ocpp/tasks.py +261 -3
- ocpp/test_export_import.py +1 -0
- ocpp/test_rfid.py +194 -6
- ocpp/tests.py +1918 -87
- ocpp/transactions_io.py +9 -1
- ocpp/urls.py +8 -3
- ocpp/views.py +700 -53
- pages/admin.py +262 -30
- pages/apps.py +35 -0
- pages/context_processors.py +28 -21
- pages/defaults.py +1 -1
- pages/forms.py +31 -8
- pages/middleware.py +6 -2
- pages/models.py +86 -2
- pages/module_defaults.py +5 -5
- pages/site_config.py +137 -0
- pages/tests.py +1050 -126
- pages/urls.py +14 -2
- pages/utils.py +70 -0
- pages/views.py +622 -56
- arthexis-0.1.16.dist-info/RECORD +0 -111
- core/workgroup_urls.py +0 -17
- core/workgroup_views.py +0 -94
- {arthexis-0.1.16.dist-info → arthexis-0.1.28.dist-info}/WHEEL +0 -0
- {arthexis-0.1.16.dist-info → arthexis-0.1.28.dist-info}/licenses/LICENSE +0 -0
- {arthexis-0.1.16.dist-info → arthexis-0.1.28.dist-info}/top_level.txt +0 -0
nodes/apps.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import os
|
|
3
3
|
import socket
|
|
4
|
+
import sys
|
|
4
5
|
import threading
|
|
5
6
|
import time
|
|
6
7
|
from pathlib import Path
|
|
@@ -20,7 +21,7 @@ def _startup_notification() -> None:
|
|
|
20
21
|
|
|
21
22
|
host = socket.gethostname()
|
|
22
23
|
|
|
23
|
-
port = os.environ.get("PORT", "
|
|
24
|
+
port = os.environ.get("PORT", "8888")
|
|
24
25
|
|
|
25
26
|
version = ""
|
|
26
27
|
ver_path = Path(settings.BASE_DIR) / "VERSION"
|
|
@@ -66,6 +67,10 @@ def _startup_notification() -> None:
|
|
|
66
67
|
def _trigger_startup_notification(**_: object) -> None:
|
|
67
68
|
"""Attempt to send the startup notification in the background."""
|
|
68
69
|
|
|
70
|
+
if _is_running_migration_command():
|
|
71
|
+
logger.debug("Startup notification skipped: running migration command")
|
|
72
|
+
return
|
|
73
|
+
|
|
69
74
|
try:
|
|
70
75
|
connections["default"].ensure_connection()
|
|
71
76
|
except OperationalError:
|
|
@@ -74,6 +79,12 @@ def _trigger_startup_notification(**_: object) -> None:
|
|
|
74
79
|
_startup_notification()
|
|
75
80
|
|
|
76
81
|
|
|
82
|
+
def _is_running_migration_command() -> bool:
|
|
83
|
+
"""Return ``True`` when Django's ``migrate`` command is executing."""
|
|
84
|
+
|
|
85
|
+
return len(sys.argv) > 1 and sys.argv[1] == "migrate"
|
|
86
|
+
|
|
87
|
+
|
|
77
88
|
class NodesConfig(AppConfig):
|
|
78
89
|
default_auto_field = "django.db.models.BigAutoField"
|
|
79
90
|
name = "nodes"
|
nodes/feature_checks.py
CHANGED
|
@@ -91,6 +91,36 @@ class FeatureCheckRegistry:
|
|
|
91
91
|
feature_checks = FeatureCheckRegistry()
|
|
92
92
|
|
|
93
93
|
|
|
94
|
+
@feature_checks.register("audio-capture")
|
|
95
|
+
def _check_audio_capture(feature: "NodeFeature", node: Optional["Node"]):
|
|
96
|
+
from .models import Node
|
|
97
|
+
|
|
98
|
+
target: Optional["Node"] = node or Node.get_local()
|
|
99
|
+
if target is None:
|
|
100
|
+
return FeatureCheckResult(
|
|
101
|
+
False,
|
|
102
|
+
f"No local node is registered; cannot verify {feature.display}.",
|
|
103
|
+
messages.WARNING,
|
|
104
|
+
)
|
|
105
|
+
if not Node._has_audio_capture_device():
|
|
106
|
+
return FeatureCheckResult(
|
|
107
|
+
False,
|
|
108
|
+
f"No audio recording device detected on {target.hostname} for {feature.display}.",
|
|
109
|
+
messages.WARNING,
|
|
110
|
+
)
|
|
111
|
+
if not target.has_feature("audio-capture"):
|
|
112
|
+
return FeatureCheckResult(
|
|
113
|
+
False,
|
|
114
|
+
f"{feature.display} is not enabled on {target.hostname}.",
|
|
115
|
+
messages.WARNING,
|
|
116
|
+
)
|
|
117
|
+
return FeatureCheckResult(
|
|
118
|
+
True,
|
|
119
|
+
f"{feature.display} is enabled on {target.hostname} and a recording device is available.",
|
|
120
|
+
messages.SUCCESS,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
|
|
94
124
|
@feature_checks.register_default
|
|
95
125
|
def _default_feature_check(
|
|
96
126
|
feature: "NodeFeature", node: Optional["Node"]
|