Example #1
0
 def __init__(self, file_path=None):
     super(DocumentModel, self).__init__()
     self.id = self._createDocumentId()
     self._preamble = Preferences.getPreambleTemplate()
     self._source = DocumentModel.DEFAULT_SOURCE
     self._dirty = False
     self._file_path = file_path
Example #2
0
 def __init__(self, file_path=None):
     super(DocumentModel, self).__init__()
     self.id = self._createDocumentId()
     self._preamble = Preferences.getPreambleTemplate()
     self._source = DocumentModel.DEFAULT_SOURCE
     self._dirty = False
     self._file_path = file_path
Example #3
0
    def save(self):
        """
		To save the document, we write the content to the file path and un-
		dirty the document.
		"""
        try:
            template = Preferences.getLatexFileTemplate()
            documentIO.writeDocumentToFilePath(template, self, self.file_path)
            self.dirty = False
        except Exception, e:
            raise DocumentError("The document cannot be saved: %s" % unicode(e))
Example #4
0
    def save(self):
        """
		To save the document, we write the content to the file path and un-
		dirty the document.
		"""
        try:
            template = Preferences.getLatexFileTemplate()
            documentIO.writeDocumentToFilePath(template, self, self.file_path)
            self.dirty = False
        except Exception, e:
            raise DocumentError("The document cannot be saved: %s" %
                                unicode(e))
Example #5
0
 def isEmpty(self):
     return self.preamble == Preferences.getPreambleTemplate() and self.source == DocumentModel.DEFAULT_SOURCE
Example #6
0
 def isEmpty(self):
     return (self.preamble == Preferences.getPreambleTemplate()
             and self.source == DocumentModel.DEFAULT_SOURCE)