Skip to content

Commit 85c4435

Browse files
committed
[doc] Add origin_file_name accessors
Closes #358
1 parent ae763e6 commit 85c4435

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

odml/doc.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,20 @@ def parent(self):
122122
""" The parent of a document is always None. """
123123
return None
124124

125+
@property
126+
def origin_file_name(self):
127+
"""
128+
If available, the file name from where the document has been loaded.
129+
Will not be serialized to file when saving the document.
130+
"""
131+
return self._origin_file_name
132+
133+
@origin_file_name.setter
134+
def origin_file_name(self, new_value):
135+
if not new_value:
136+
new_value = None
137+
self._origin_file_name = new_value
138+
125139
def finalize(self):
126140
"""
127141
This needs to be called after the document is set up from parsing

0 commit comments

Comments
 (0)