class documentation

class Archive(object):

View In Hierarchy

Undocumented

Static Method parse_filename Given an filename return the basename (filename without the archive and compression extensions), archive format and compression method used.
Class Variable Ext_aliases Undocumented
Class Variable Formats Undocumented
@staticmethod
def parse_filename(filename):

Given an filename return the basename (filename without the archive and compression extensions), archive format and compression method used.

Parameters
filename:stringthe name of the file
Returns

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)
tuple containing basename, archive format and compression method
Ext_aliases: dict =

Undocumented

Formats: list[str] =

Undocumented