def __init__(self, room, id=None, path=None, proto=None): DirectEditDocument.__init__(self, room, id) self._editDoc = None self._path = path self._proto = proto from viewer import Viewer self._catch(Viewer.In.Document, self._editDocChanged)
def _saveAs(self, pillow, newID): if self._doc == None: newDoc = self._editDoc.clone() newDoc.resetDocumentID(newID) newDoc.overwrite(None, self._proto) from documentCache import DocumentCache self._throw(DocumentCache.In.CreateAndSaveDocument, newDoc._data) return self._doc.set(self._path, self._editDoc.get(self._path)) DirectEditDocument._saveAs(self, pillow, newID)