Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 5
0
 def isEmpty(self):
     return self.preamble == Preferences.getPreambleTemplate() and self.source == DocumentModel.DEFAULT_SOURCE
Exemplo n.º 6
0
 def isEmpty(self):
     return (self.preamble == Preferences.getPreambleTemplate()
             and self.source == DocumentModel.DEFAULT_SOURCE)