gbp.pkg.archive.Archive(object)
class documentationgbp.pkg.archive
(View In Hierarchy)
Class Variable | Formats | Undocumented (type: List[str] ) |
Class Variable | Ext_aliases | Undocumented (type: Dict ) |
Static Method | parse_filename | Given an filename return the basename (filename without the archive and compression extensions), archive format and compression method used. |
Given an filename return the basename (filename without the archive and compression extensions), archive format and compression method used.
Parameters | filename | the name of the file (type: string) |
Returns | tuple containing basename, archive format and compression method (type: tuple of str >>> Archive.parse_filename("abc.tar.gz") ('abc', 'tar', 'gzip') >>> Archive.parse_filename("abc.tar.bz2") ('abc', 'tar', 'bzip2') >>> Archive.parse_filename("abc.def.tbz2") ('abc.def', 'tar', 'bzip2') >>> Archive.parse_filename("abc.def.tar.xz") ('abc.def', 'tar', 'xz') >>> Archive.parse_filename("abc.zip") ('abc', 'zip', None) >>> Archive.parse_filename("abc.lzma") ('abc', None, 'lzma') >>> Archive.parse_filename("abc.tar.foo") ('abc.tar.foo', None, None) >>> Archive.parse_filename("abc") ('abc', None, None)) |