示例#1
0
文件: Abstract.py 项目: Zenwolf/jasy
    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
示例#2
0
    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