wad.py 文件源码

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

项目:game-tools 作者: joshuaskelly 项目源码 文件源码
def from_file(cls, filename):
        st = os.stat(filename)
        isdir = stat.S_ISDIR(st.st_mode)
        arcname = os.path.normpath(os.path.splitdrive(filename)[1])[-16:]

        while arcname[0] in (os.sep, os.altsep):
            arcname = arcname[1:]

        if isdir:
            raise RuntimeError('WadFile expects a file, got a directory')

        info = cls(arcname)
        info.type = TYPE_LUMP
        info.file_size = st.st_size
        info.disk_size = st.st_size
        info.filename = os.path.basename(arcname)[-16:]

        return info
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号