pycrdt 0.12.37__cp313-cp313-win32.whl → 0.12.40__cp313-cp313-win32.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 pycrdt might be problematic. Click here for more details.
- pycrdt/_base.py +9 -4
- pycrdt/_provider.py +2 -4
- pycrdt/_pycrdt.cp313-win32.pyd +0 -0
- pycrdt/_transaction.py +12 -10
- {pycrdt-0.12.37.dist-info → pycrdt-0.12.40.dist-info}/METADATA +1 -1
- {pycrdt-0.12.37.dist-info → pycrdt-0.12.40.dist-info}/RECORD +8 -8
- {pycrdt-0.12.37.dist-info → pycrdt-0.12.40.dist-info}/WHEEL +1 -1
- {pycrdt-0.12.37.dist-info → pycrdt-0.12.40.dist-info}/licenses/LICENSE +0 -0
pycrdt/_base.py
CHANGED
|
@@ -4,6 +4,7 @@ import threading
|
|
|
4
4
|
from abc import ABC, abstractmethod
|
|
5
5
|
from functools import lru_cache, partial
|
|
6
6
|
from inspect import signature
|
|
7
|
+
from types import UnionType
|
|
7
8
|
from typing import (
|
|
8
9
|
TYPE_CHECKING,
|
|
9
10
|
Any,
|
|
@@ -12,6 +13,8 @@ from typing import (
|
|
|
12
13
|
Type,
|
|
13
14
|
Union,
|
|
14
15
|
cast,
|
|
16
|
+
get_args,
|
|
17
|
+
get_origin,
|
|
15
18
|
get_type_hints,
|
|
16
19
|
overload,
|
|
17
20
|
)
|
|
@@ -388,10 +391,12 @@ class Typed:
|
|
|
388
391
|
if key not in annotations:
|
|
389
392
|
raise AttributeError(f'"{type(self).mro()[0]}" has no attribute "{key}"')
|
|
390
393
|
expected_type = annotations[key]
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
394
|
+
origin = get_origin(expected_type)
|
|
395
|
+
if origin in (Union, UnionType):
|
|
396
|
+
expected_types = get_args(expected_type)
|
|
397
|
+
elif origin is not None:
|
|
398
|
+
expected_type = origin
|
|
399
|
+
expected_types = (expected_type,)
|
|
395
400
|
else:
|
|
396
401
|
expected_types = (expected_type,)
|
|
397
402
|
if type(value) not in expected_types:
|
pycrdt/_provider.py
CHANGED
|
@@ -141,10 +141,8 @@ class Provider:
|
|
|
141
141
|
return self
|
|
142
142
|
|
|
143
143
|
async def __aexit__(self, exc_type, exc_value, exc_tb):
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
finally:
|
|
147
|
-
return await self._exit_stack.__aexit__(exc_type, exc_value, exc_tb)
|
|
144
|
+
await self.stop()
|
|
145
|
+
return await self._exit_stack.__aexit__(exc_type, exc_value, exc_tb)
|
|
148
146
|
|
|
149
147
|
@asynccontextmanager
|
|
150
148
|
async def _get_or_create_task_group(self) -> AsyncIterator[TaskGroup]:
|
pycrdt/_pycrdt.cp313-win32.pyd
CHANGED
|
Binary file
|
pycrdt/_transaction.py
CHANGED
|
@@ -73,16 +73,18 @@ class Transaction:
|
|
|
73
73
|
# since nested transactions reuse the root transaction
|
|
74
74
|
if self._leases == 0:
|
|
75
75
|
assert self._txn is not None
|
|
76
|
-
|
|
77
|
-
self
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
self._doc.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
try:
|
|
77
|
+
if not isinstance(self, ReadTransaction):
|
|
78
|
+
self._txn.commit()
|
|
79
|
+
origin_hash = self._txn.origin()
|
|
80
|
+
if origin_hash is not None:
|
|
81
|
+
del self._doc._origins[origin_hash]
|
|
82
|
+
if self._doc._allow_multithreading:
|
|
83
|
+
self._doc._txn_lock.release()
|
|
84
|
+
finally:
|
|
85
|
+
self._txn.drop()
|
|
86
|
+
self._txn = None
|
|
87
|
+
self._doc._txn = None
|
|
86
88
|
|
|
87
89
|
async def __aenter__(self, _acquire_transaction: bool = True) -> Transaction:
|
|
88
90
|
if self._leases > 0 and self._doc._task_group is None:
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
pycrdt-0.12.
|
|
2
|
-
pycrdt-0.12.
|
|
3
|
-
pycrdt-0.12.
|
|
1
|
+
pycrdt-0.12.40.dist-info/METADATA,sha256=VFcq9q1IHJd0bWaTTdfhUsTwjHvFsly4bwCk5-OpYOc,1487
|
|
2
|
+
pycrdt-0.12.40.dist-info/WHEEL,sha256=JxUeaYp69WTmPUBx4dkPAWqxDm8JFrAL_AcImdz_qsY,92
|
|
3
|
+
pycrdt-0.12.40.dist-info/licenses/LICENSE,sha256=-uIz47KBJpIuEvvMUTwpg6OAiJJuqYajA4bW7QJ9o18,1102
|
|
4
4
|
pycrdt/__init__.py,sha256=2fK0vWlJyzGEx767phtTDHrkCsEn0p4ftNxAFOK70CU,2150
|
|
5
5
|
pycrdt/_array.py,sha256=YflwaoYzi_fSf9fLexyBrVJXGmJM5MJSBdQfn9HDRyE,15099
|
|
6
6
|
pycrdt/_awareness.py,sha256=mKPNp5PVehxqy_cP1ErhITbp8YY52C3Ux2BsEuu8778,11208
|
|
7
|
-
pycrdt/_base.py,sha256=
|
|
7
|
+
pycrdt/_base.py,sha256=4iw_7jtEwyZrzPCW_z9L8tZ7iq3aiVn55miB3dsBAXk,13482
|
|
8
8
|
pycrdt/_doc.py,sha256=Hqxfs4GiCCxbbJ8kRL-mCMf3g1ZCRlfJ2pgmBPXO5r0,17305
|
|
9
9
|
pycrdt/_map.py,sha256=2qPHaWX6U0dMy7QRkXclCsFO6Zt13UCtmJL332CtxSM,10969
|
|
10
|
-
pycrdt/_provider.py,sha256=
|
|
11
|
-
pycrdt/_pycrdt.cp313-win32.pyd,sha256=
|
|
10
|
+
pycrdt/_provider.py,sha256=E_fzs44tWvYa_NGd5HE6dUVd6N2B1S8S4d-sX_Ao6Es,5471
|
|
11
|
+
pycrdt/_pycrdt.cp313-win32.pyd,sha256=aUPczC7f7dq1FPGNpY3ONNL2sPaT9tI-eTBEW4W09O0,1528320
|
|
12
12
|
pycrdt/_pycrdt.pyi,sha256=arzSIfs4E60vlWQ2y4s3l5tOsZaI7EzqrZnTUlWI7Lo,16614
|
|
13
13
|
pycrdt/_snapshot.py,sha256=BpApwJ9WVqtJvXHHI_lu6KgaJxYS_Q2rMp9Y6R1H9EE,1422
|
|
14
14
|
pycrdt/_sticky_index.py,sha256=GL4vNGPqqgLOGj_tm_1SDiAo6NuudvGAkXaTDvvuFi0,4612
|
|
15
15
|
pycrdt/_sync.py,sha256=J9Czx3SxZ1_i-b8rkaeTju8ygCxcWYqejpBKvlfEvmU,8118
|
|
16
16
|
pycrdt/_text.py,sha256=qxv7LZEWI7wSkK3hzXkIBw6AUu3zFJp6gYqac7B5ato,10726
|
|
17
|
-
pycrdt/_transaction.py,sha256=
|
|
17
|
+
pycrdt/_transaction.py,sha256=lUm1b_viNqPjKjBDEVPOZwSWhos_e3utnAU-LzPNMrg,5615
|
|
18
18
|
pycrdt/_undo.py,sha256=t7EjnQ7mta4dKyzqpGcCEVtTrITTY8aQ15ZpiVur8JE,4211
|
|
19
19
|
pycrdt/_update.py,sha256=odt-Dsq2vKQTW_yfiqukmRTs5T6E4pe5Wl_PtrhH71w,1202
|
|
20
20
|
pycrdt/_version.py,sha256=1B-NXFpddZSmM_1TNhtXeKRiTr9WBOpl5Mftxt7zCDc,190
|
|
21
21
|
pycrdt/_xml.py,sha256=jHRpLpC07oH4KDY2RskGQ7HTcMqO-TFQj56xbnnwejM,18870
|
|
22
22
|
pycrdt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
|
-
pycrdt-0.12.
|
|
23
|
+
pycrdt-0.12.40.dist-info/RECORD,,
|
|
File without changes
|