IncludeCPP 3.7.17__py3-none-any.whl → 3.7.18__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.
- includecpp/__init__.py +1 -1
- includecpp/core/cssl_bridge.py +51 -0
- {includecpp-3.7.17.dist-info → includecpp-3.7.18.dist-info}/METADATA +1 -1
- {includecpp-3.7.17.dist-info → includecpp-3.7.18.dist-info}/RECORD +8 -8
- {includecpp-3.7.17.dist-info → includecpp-3.7.18.dist-info}/WHEEL +0 -0
- {includecpp-3.7.17.dist-info → includecpp-3.7.18.dist-info}/entry_points.txt +0 -0
- {includecpp-3.7.17.dist-info → includecpp-3.7.18.dist-info}/licenses/LICENSE +0 -0
- {includecpp-3.7.17.dist-info → includecpp-3.7.18.dist-info}/top_level.txt +0 -0
includecpp/__init__.py
CHANGED
includecpp/core/cssl_bridge.py
CHANGED
|
@@ -11,6 +11,7 @@ v3.8.0 API:
|
|
|
11
11
|
cssl.include(path, name) - Register for payload(name)
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
|
+
import atexit
|
|
14
15
|
import os
|
|
15
16
|
import pickle
|
|
16
17
|
import random
|
|
@@ -33,6 +34,23 @@ def _get_share_directory() -> Path:
|
|
|
33
34
|
return share_dir
|
|
34
35
|
|
|
35
36
|
|
|
37
|
+
def _cleanup_shared_objects() -> None:
|
|
38
|
+
"""Clean up all shared object marker files on process exit."""
|
|
39
|
+
try:
|
|
40
|
+
share_dir = _get_share_directory()
|
|
41
|
+
if share_dir.exists():
|
|
42
|
+
for f in share_dir.glob('*.shareobj*'):
|
|
43
|
+
try:
|
|
44
|
+
f.unlink()
|
|
45
|
+
except Exception:
|
|
46
|
+
pass
|
|
47
|
+
except Exception:
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
# Register cleanup on process exit
|
|
51
|
+
atexit.register(_cleanup_shared_objects)
|
|
52
|
+
|
|
53
|
+
|
|
36
54
|
# Global live object registry - holds actual object references for live sharing
|
|
37
55
|
_live_objects: Dict[str, Any] = {}
|
|
38
56
|
|
|
@@ -1064,6 +1082,38 @@ def shared(name: str) -> Optional[Any]:
|
|
|
1064
1082
|
return get_shared(name)
|
|
1065
1083
|
|
|
1066
1084
|
|
|
1085
|
+
def cleanup_shared() -> int:
|
|
1086
|
+
"""
|
|
1087
|
+
Manually clean up all shared object marker files.
|
|
1088
|
+
|
|
1089
|
+
Call this to remove stale .shareobj files from %APPDATA%/IncludeCPP/shared_objects/
|
|
1090
|
+
that may have accumulated from previous sessions.
|
|
1091
|
+
|
|
1092
|
+
Returns:
|
|
1093
|
+
Number of files deleted
|
|
1094
|
+
"""
|
|
1095
|
+
global _live_objects, _global_shared_objects
|
|
1096
|
+
|
|
1097
|
+
count = 0
|
|
1098
|
+
try:
|
|
1099
|
+
share_dir = _get_share_directory()
|
|
1100
|
+
if share_dir.exists():
|
|
1101
|
+
for f in share_dir.glob('*.shareobj*'):
|
|
1102
|
+
try:
|
|
1103
|
+
f.unlink()
|
|
1104
|
+
count += 1
|
|
1105
|
+
except Exception:
|
|
1106
|
+
pass
|
|
1107
|
+
except Exception:
|
|
1108
|
+
pass
|
|
1109
|
+
|
|
1110
|
+
# Clear in-memory registries
|
|
1111
|
+
_live_objects.clear()
|
|
1112
|
+
_global_shared_objects.clear()
|
|
1113
|
+
|
|
1114
|
+
return count
|
|
1115
|
+
|
|
1116
|
+
|
|
1067
1117
|
# Singleton for convenience
|
|
1068
1118
|
_default_instance: Optional[CsslLang] = None
|
|
1069
1119
|
|
|
@@ -1308,4 +1358,5 @@ __all__ = [
|
|
|
1308
1358
|
'unshare',
|
|
1309
1359
|
'shared',
|
|
1310
1360
|
'get_shared',
|
|
1361
|
+
'cleanup_shared',
|
|
1311
1362
|
]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
includecpp/__init__.py,sha256=
|
|
1
|
+
includecpp/__init__.py,sha256=b_4C-zCq722_wYJW7FR6_vA3fJkKC_yguejM1dIQOWk,1673
|
|
2
2
|
includecpp/__init__.pyi,sha256=uSDYlbqd2TinmrdepmE_zvN25jd3Co2cgyPzXgDpopM,7193
|
|
3
3
|
includecpp/__main__.py,sha256=d6QK0PkvUe1ENofpmHRAg3bwNbZr8PiRscfI3-WRfVg,72
|
|
4
4
|
includecpp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -11,7 +11,7 @@ includecpp/core/build_manager.py,sha256=uLuYsuiC6OsOGaU5wAJfl4M3IbdnIDgogfMd8VsV
|
|
|
11
11
|
includecpp/core/cpp_api.py,sha256=8y_B1L18rhSBZln654xPPzqO2PdvAlLpJrfEjzl7Wnc,14039
|
|
12
12
|
includecpp/core/cpp_api.pyi,sha256=IEiaKqaPItnn6rjL7aK32D3o9FYmRYCgCZbqiQNUwdc,3496
|
|
13
13
|
includecpp/core/cppy_converter.py,sha256=b7yqu-aoa0wShNY0GvQT67TnNhYya4GyYmG7oDdqDV4,156686
|
|
14
|
-
includecpp/core/cssl_bridge.py,sha256=
|
|
14
|
+
includecpp/core/cssl_bridge.py,sha256=mbNsfq9T9NuY7duqTVYe7rmRlumXG-Y5dDAfeBpwtzM,42610
|
|
15
15
|
includecpp/core/cssl_bridge.pyi,sha256=tQxb3lneufgVmXSAqDUwjoluUNo8Wa5QIOnaL8ai6q0,12055
|
|
16
16
|
includecpp/core/error_catalog.py,sha256=VS3N-P0yEbiHimsDPtcaYfrUb7mXQ-7pqw18PtSngaU,33869
|
|
17
17
|
includecpp/core/error_formatter.py,sha256=7-MzRIT8cM4uODxy0IZ9pu7pqR4Pq2I8Si0QQZHjmVc,39239
|
|
@@ -43,9 +43,9 @@ includecpp/vscode/cssl/images/cssl.png,sha256=BxAGsnfS0ZzzCvqV6Zb1OAJAZpDUoXlR86
|
|
|
43
43
|
includecpp/vscode/cssl/images/cssl_pl.png,sha256=z4WMk7g6YCTbUUbSFk343BO6yi_OmNEVYkRenWGydwM,799
|
|
44
44
|
includecpp/vscode/cssl/snippets/cssl.snippets.json,sha256=l4SCEPR3CsPxA8HIVLKYY__I979TfKzYWtH1KYIsboo,33062
|
|
45
45
|
includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json,sha256=XKRLBOHlCqDDnGPvmNHDQPsIMR1UD9PBaJIlgZOiPqM,21173
|
|
46
|
-
includecpp-3.7.
|
|
47
|
-
includecpp-3.7.
|
|
48
|
-
includecpp-3.7.
|
|
49
|
-
includecpp-3.7.
|
|
50
|
-
includecpp-3.7.
|
|
51
|
-
includecpp-3.7.
|
|
46
|
+
includecpp-3.7.18.dist-info/licenses/LICENSE,sha256=fWCsGGsiWZir0UzDd20Hh-3wtRyk1zqUntvtVuAWhvc,1093
|
|
47
|
+
includecpp-3.7.18.dist-info/METADATA,sha256=oXA8PPiLX5nfuNJH9R_X9N_nex0u-8LtNLh3V_b1ea8,32122
|
|
48
|
+
includecpp-3.7.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
49
|
+
includecpp-3.7.18.dist-info/entry_points.txt,sha256=6A5Mif9gi0139Bf03W5plAb3wnAgbNaEVe1HJoGE-2o,59
|
|
50
|
+
includecpp-3.7.18.dist-info/top_level.txt,sha256=RFUaR1KG-M6mCYwP6w4ydP5Cgc8yNbP78jxGAvyjMa8,11
|
|
51
|
+
includecpp-3.7.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|