ccoding 0.2.4__tar.gz → 0.2.5__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.
- {ccoding-0.2.4 → ccoding-0.2.5}/PKG-INFO +1 -1
- {ccoding-0.2.4 → ccoding-0.2.5}/pyproject.toml +1 -1
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/remote_common.py +25 -3
- {ccoding-0.2.4 → ccoding-0.2.5}/uv.lock +1 -1
- {ccoding-0.2.4 → ccoding-0.2.5}/.github/workflows/publish.yml +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/.gitignore +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/CLAUDE.md +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/LICENSE +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/README.md +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/screenshot.png +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/screenshot_mobile1.jpeg +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/screenshot_mobile2.jpeg +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/__init__.py +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/__main__.py +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/api.py +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/cli.py +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/config.py +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/env_schema.json +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/logo.py +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/remote.py +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/remote_cli.py +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/remote_client.py +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/remote_server.py +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/ui.py +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/web/__init__.py +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/web/app.js +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/web/assets/addon-fit.js +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/web/assets/xterm-LICENSE +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/web/assets/xterm-addon-fit-LICENSE +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/web/assets/xterm.css +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/web/assets/xterm.js +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/web/index.html +0 -0
- {ccoding-0.2.4 → ccoding-0.2.5}/src/ccode/web/style.css +0 -0
|
@@ -3,11 +3,20 @@ from __future__ import annotations
|
|
|
3
3
|
import base64
|
|
4
4
|
import contextlib
|
|
5
5
|
import datetime as dt
|
|
6
|
-
import fcntl
|
|
7
6
|
import hashlib
|
|
8
7
|
import hmac
|
|
9
8
|
import os
|
|
10
9
|
import re
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
import fcntl
|
|
13
|
+
except ImportError:
|
|
14
|
+
fcntl = None
|
|
15
|
+
|
|
16
|
+
try:
|
|
17
|
+
import msvcrt
|
|
18
|
+
except ImportError:
|
|
19
|
+
msvcrt = None
|
|
11
20
|
import secrets
|
|
12
21
|
import time
|
|
13
22
|
from dataclasses import dataclass
|
|
@@ -209,11 +218,24 @@ def web_asset_text(name: str) -> str:
|
|
|
209
218
|
def file_lock(path: Any) -> Iterator[None]:
|
|
210
219
|
CONFIG_DIR.mkdir(parents=True, exist_ok=True)
|
|
211
220
|
with path.open("a+") as lock_file:
|
|
212
|
-
|
|
221
|
+
if msvcrt is not None:
|
|
222
|
+
if path.stat().st_size == 0:
|
|
223
|
+
lock_file.write("0")
|
|
224
|
+
lock_file.flush()
|
|
225
|
+
lock_file.seek(0)
|
|
226
|
+
getattr(msvcrt, "locking")(lock_file.fileno(), getattr(msvcrt, "LK_LOCK"), 1)
|
|
227
|
+
elif fcntl is not None:
|
|
228
|
+
fcntl.flock(lock_file.fileno(), fcntl.LOCK_EX)
|
|
229
|
+
else:
|
|
230
|
+
raise OSError("file locking is not supported on this platform")
|
|
213
231
|
try:
|
|
214
232
|
yield
|
|
215
233
|
finally:
|
|
216
|
-
|
|
234
|
+
if msvcrt is not None:
|
|
235
|
+
lock_file.seek(0)
|
|
236
|
+
getattr(msvcrt, "locking")(lock_file.fileno(), getattr(msvcrt, "LK_UNLCK"), 1)
|
|
237
|
+
elif fcntl is not None:
|
|
238
|
+
fcntl.flock(lock_file.fileno(), fcntl.LOCK_UN)
|
|
217
239
|
|
|
218
240
|
|
|
219
241
|
def rotate_log(path: Any, max_bytes: int, backups: int) -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|