-
Notifications
You must be signed in to change notification settings - Fork 22
Doc awareness #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc awareness #277
Changes from 2 commits
7845ff7
dc91692
3aa8387
c1b0496
a8af145
8c74b23
4612306
8c780d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,6 +5,7 @@ | |||||
from typing import Any, Callable, Dict, Optional | ||||||
|
||||||
from pycrdt import Doc, Map, Subscription, UndoManager | ||||||
from pycrdt_websocket.awareness import Awareness | ||||||
|
||||||
|
||||||
class YBaseDoc(ABC): | ||||||
|
@@ -20,7 +21,7 @@ class YBaseDoc(ABC): | |||||
_subscriptions: Dict[Any, Subscription] | ||||||
_undo_manager: UndoManager | ||||||
|
||||||
def __init__(self, ydoc: Optional[Doc] = None): | ||||||
def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] = None): | ||||||
""" | ||||||
Constructs a YBaseDoc. | ||||||
|
||||||
|
@@ -31,6 +32,9 @@ def __init__(self, ydoc: Optional[Doc] = None): | |||||
self._ydoc = Doc() | ||||||
else: | ||||||
self._ydoc = ydoc | ||||||
|
||||||
self._awareness = awareness | ||||||
|
self._awareness = awareness | |
self.awareness = awareness |
And remove the getter and setter as they do nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe we should only remove the setter, to make awareness
read only, it is not supposed to be set later.
What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the getter and setter.
Uh oh!
There was an error while loading. Please reload this page.