コード例 #1
0
    def infoiter(self):
        """Iterate over all the files in the archive, generating RarInfos.

        >>> import os
        >>> for fileInArchive in RarFile('test.rar').infoiter():
        ...     print os.path.split(fileInArchive.filename)[-1],
        ...     print fileInArchive.isdir,
        ...     print fileInArchive.size,
        ...     print fileInArchive.comment,
        ...     print tuple(fileInArchive.datetime)[0:5],
        ...     print time.strftime('%a, %d %b %Y %H:%M', fileInArchive.datetime)
        test True 0 None (2003, 6, 30, 1, 59) Mon, 30 Jun 2003 01:59
        test.txt False 20 None (2003, 6, 30, 2, 1) Mon, 30 Jun 2003 02:01
        this.py False 1030 None (2002, 2, 8, 16, 47) Fri, 08 Feb 2002 16:47
        """
        for params in RarFileImplementation.infoiter(self):
            yield RarInfo(self, params)
コード例 #2
0
ファイル: __init__.py プロジェクト: Amohell/ComicStreamer
    def infoiter(self):
        """Iterate over all the files in the archive, generating RarInfos.

        >>> import os
        >>> for fileInArchive in RarFile('test.rar').infoiter():
        ...     print os.path.split(fileInArchive.filename)[-1],
        ...     print fileInArchive.isdir,
        ...     print fileInArchive.size,
        ...     print fileInArchive.comment,
        ...     print tuple(fileInArchive.datetime)[0:5],
        ...     print time.strftime('%a, %d %b %Y %H:%M', fileInArchive.datetime)
        test True 0 None (2003, 6, 30, 1, 59) Mon, 30 Jun 2003 01:59
        test.txt False 20 None (2003, 6, 30, 2, 1) Mon, 30 Jun 2003 02:01
        this.py False 1030 None (2002, 2, 8, 16, 47) Fri, 08 Feb 2002 16:47
        """
        for params in RarFileImplementation.infoiter(self):
            yield RarInfo(self, params)