File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,16 @@ def path(self) -> Optional[str]:
110
110
"""
111
111
return self ._ystate .get ("path" )
112
112
113
+ @property
114
+ def file_id (self ) -> Optional [str ]:
115
+ """
116
+ Returns document's file ID.
117
+
118
+ :return: Document's file ID.
119
+ :rtype: Optional[str]
120
+ """
121
+ return self ._ystate .get ("file_id" )
122
+
113
123
@path .setter
114
124
def path (self , value : str ) -> None :
115
125
"""
@@ -121,6 +131,17 @@ def path(self, value: str) -> None:
121
131
with self ._ydoc .begin_transaction () as t :
122
132
self ._ystate .set (t , "path" , value )
123
133
134
+ @file_id .setter
135
+ def file_id (self , value : str ) -> None :
136
+ """
137
+ Sets document's file ID.
138
+
139
+ :param value: Document's file ID.
140
+ :type value: str
141
+ """
142
+ with self ._ydoc .begin_transaction () as t :
143
+ self ._ystate .set (t , "file_id" , value )
144
+
124
145
@abstractmethod
125
146
def get (self ) -> Any :
126
147
"""
Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ def set(self, value: Dict) -> None:
254
254
self ._ymeta .pop (t , key )
255
255
if cells_len :
256
256
self ._ycells .delete_range (t , 0 , cells_len )
257
- for key in [k for k in self ._ystate if k not in ("dirty" , "path" )]:
257
+ for key in [k for k in self ._ystate if k not in ("dirty" , "path" , "file_id" )]:
258
258
self ._ystate .pop (t , key )
259
259
260
260
# initialize document
You can’t perform that action at this time.
0 commit comments