storage.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:tissuelab 作者: VirtualPlants 项目源码 文件源码
def save(self, name, content):
        """
        Saves new content to the file specified by name. The content should be
        a proper File object or any python file-like object, ready to be read
        from the beginning.
        """
        # Get the proper name for the file, as it will actually be saved.
        if name is None:
            name = content.name

        if not hasattr(content, 'chunks'):
            content = File(content)

        name = self.get_available_name(name)
        name = self._save(name, content)

        # Store filenames with forward slashes, even on Windows
        return force_text(name.replace('\\', '/'))

    # These methods are part of the public API, with default implementations.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号