def getPath(self): """Returns the exact position of the class file in the file system.""" # Automatically write file (from eventually processed text content) when it does not exist if self.__text is not None and not File.exists(self.__path): File.write(self.__path, self.getText()) return self.__path
def saveText(self, text, path, encoding="utf-8"): """ Saves the given text under the given path and stores both for future access This is mainly useful for "virtual" files which are not edited by the developer but which are created dynamically during runtime. """ self.__text = text self.__path = path if not File.exists(path) or File.read(path) != text: File.write(path, text) self.mtime = os.stat(path).st_mtime
def saveText(self, text, path, encoding="utf-8"): """ Saves the given text under the given path and stores both for future access. This is mainly useful for "virtual" files which are not edited by the developer but which are created dynamically during runtime. """ self.__text = text self.__path = path if not File.exists(path) or File.read(path) != text: File.write(path, text) self.mtime = os.stat(path).st_mtime