示例#1
0
    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
示例#2
0
    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
示例#3
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
示例#4
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