示例#1
0
	def open(self):
		"""
		To open the document, we read the content from the file path and un-
		dirty the document.
		"""
		try:
			if File.exists(self.file_path):
				(self.preamble, self.source) = documentIO.readPreambleAndSourceFromFilePath(self.file_path)
			self.dirty = False
		except Exception as e:
			raise DocumentError("The document cannot be opened: %s" % str(e))
示例#2
0
    def open(self):
        """
		To open the document, we read the content from the file path and un-
		dirty the document.
		"""
        try:
            if File.exists(self.file_path):
                (self.preamble,
                 self.source) = documentIO.readPreambleAndSourceFromFilePath(
                     self.file_path)
            self.dirty = False
        except Exception as e:
            raise DocumentError("The document cannot be opened: %s" % str(e))
示例#3
0
 def _checkFileExists(self):
     if not File.exists(self.file_path):
         raise DocumentReaderError("The file does not exist")
示例#4
0
	def _checkFileExists(self):
		if not File.exists(self.file_path):
			raise DocumentReaderError("The file does not exist")