Skip to content

Commit c1b0496

Browse files
Apply suggestions from code review
Co-authored-by: David Brochart <[email protected]>
1 parent 3aa8387 commit c1b0496

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

jupyter_ydoc/ybasedoc.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] =
2626
2727
:param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided.
2828
:type ydoc: :class:`pycrdt.Doc`, optional.
29+
:param awareness: The :class:`pycrdt.Awareness` that share non persistent data
30+
between clients.
31+
:type awareness: :class:`pycrdt.Awareness`, optional.
2932
"""
3033
if ydoc is None:
3134
self._ydoc = Doc()
3235
else:
3336
self._ydoc = ydoc
34-
3537
self._awareness = awareness
3638

3739
self._ystate = self._ydoc.get("state", type=Map)
@@ -80,19 +82,20 @@ def ydoc(self) -> Doc:
8082
@property
8183
def awareness(self) -> Awareness | None:
8284
"""
83-
Return the awareness.
85+
Returns the awareness.
8486
8587
:return: The document's awareness.
86-
:rtype: :class:`pycrdt_websocket.awareness.Awareness`
88+
:rtype: :class:`pycrdt.Awareness` or None.
8789
"""
8890
return self._awareness
8991

9092
@awareness.setter
91-
def awareness(self, value: Awareness):
93+
def awareness(self, value: Awareness) -> None:
9294
"""
9395
Sets the awareness.
9496
95-
:param: The awareness.
97+
:param value: The awareness to set.
98+
:type value: :class:`pycrdt.Awareness`.
9699
"""
97100
self._awareness = value
98101

jupyter_ydoc/yblob.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] =
3030
3131
:param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided.
3232
:type ydoc: :class:`pycrdt.Doc`, optional.
33+
:param awareness: The :class:`pycrdt.Awareness` that share non persistent data
34+
between clients.
35+
:type awareness: :class:`pycrdt.Awareness`, optional.
3336
"""
3437
super().__init__(ydoc, awareness)
3538
self._ysource = self._ydoc.get("source", type=Map)

jupyter_ydoc/ynotebook.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] =
5353
5454
:param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided.
5555
:type ydoc: :class:`pycrdt.Doc`, optional.
56+
:param awareness: The :class:`pycrdt.Awareness` that share non persistent data
57+
between clients.
58+
:type awareness: :class:`pycrdt.Awareness`, optional.
5659
"""
5760
super().__init__(ydoc, awareness)
5861
self._ymeta = self._ydoc.get("meta", type=Map)

jupyter_ydoc/yunicode.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] =
2929
3030
:param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided.
3131
:type ydoc: :class:`pycrdt.Doc`, optional.
32+
:param awareness: The :class:`pycrdt.Awareness` that share non persistent data
33+
between clients.
34+
:type awareness: :class:`pycrdt.Awareness`, optional.
3235
"""
3336
super().__init__(ydoc, awareness)
3437
self._ysource = self._ydoc.get("source", type=Text)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dev = [
2828
]
2929
test = [
3030
"pre-commit",
31-
"pytest >=9.16",
31+
"pytest",
3232
"pytest-asyncio",
3333
"websockets >=10.0",
3434
"pycrdt-websocket >=0.14.1,<0.15.0",

0 commit comments

Comments
 (0)