fp-webui 0.1.1.dev0__tar.gz → 0.1.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fp-webui
3
- Version: 0.1.1.dev0
3
+ Version: 0.1.3
4
4
  Summary: 五块卵石 - Web 界面
5
5
  Author: zpb
6
6
  License-Expression: MIT
File without changes
File without changes
File without changes
@@ -29,6 +29,8 @@ import sys
29
29
  import time
30
30
  from contextlib import asynccontextmanager, suppress
31
31
 
32
+ from fp_core.platform_utils import get_data_dir
33
+
32
34
  # ── FastAPI / WebSocket ─────────────────────────────────
33
35
  try:
34
36
  import uvicorn
@@ -107,8 +109,7 @@ event_bus = EventBus()
107
109
  # ════════════════════════════════════════════════════════════
108
110
 
109
111
  _TOKEN_DIR: str = os.path.join(
110
- os.environ.get("XDG_DATA_HOME", os.path.join(os.path.expanduser("~"), ".local", "share")),
111
- "fp",
112
+ get_data_dir(),
112
113
  )
113
114
  _TOKENS_DIR: str = os.path.join(_TOKEN_DIR, "tokens")
114
115
  os.makedirs(_TOKENS_DIR, exist_ok=True)
@@ -134,6 +135,8 @@ def _load_or_create_token() -> str:
134
135
  with open(_TOKEN_FILE, "w") as f:
135
136
  f.write(new_token)
136
137
  os.chmod(_TOKEN_FILE, 0o600)
138
+ except PermissionError:
139
+ pass # Windows 不支持 chmod,静默跳过
137
140
  except OSError:
138
141
  pass
139
142
  return new_token
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fp-webui
3
- Version: 0.1.1.dev0
3
+ Version: 0.1.3
4
4
  Summary: 五块卵石 - Web 界面
5
5
  Author: zpb
6
6
  License-Expression: MIT
@@ -10,5 +10,4 @@ src/fp_webui.egg-info/requires.txt
10
10
  src/fp_webui.egg-info/top_level.txt
11
11
  src/fp_webui/static/.gitkeep
12
12
  src/fp_webui/static/background.svg
13
- src/fp_webui/static/favicon.png
14
13
  src/fp_webui/static/index.html