pi-sdk-web 0.4.0 → 0.4.1
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.
|
Binary file
|
|
Binary file
|
|
@@ -28,7 +28,23 @@ from rpc_client import RpcClient, RpcCommands
|
|
|
28
28
|
from websocket import WebSocketConnection, WebSocketServer
|
|
29
29
|
|
|
30
30
|
DEFAULT_PORT = 4080
|
|
31
|
-
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _resolve_static_dir() -> Path:
|
|
34
|
+
"""Find the static/ directory: the repo layout keeps it next to the
|
|
35
|
+
project root (server.py's parent.parent), while the npm package layout
|
|
36
|
+
ships it at dist/static (server.py lives at dist/pi-bin/server/). Search
|
|
37
|
+
upward so both layouts resolve."""
|
|
38
|
+
d = Path(__file__).resolve().parent
|
|
39
|
+
for _ in range(4):
|
|
40
|
+
candidate = d / "static"
|
|
41
|
+
if candidate.is_dir():
|
|
42
|
+
return candidate
|
|
43
|
+
d = d.parent
|
|
44
|
+
return Path(__file__).resolve().parent / "static"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
STATIC_DIR = _resolve_static_dir()
|
|
32
48
|
|
|
33
49
|
|
|
34
50
|
class Peripheral:
|