Archive module

class rebasehelper.archive.Archive(filename)[source]

Class representing an archive with sources

extract_archive(path)[source]

Extracts the archive into the given path

Parameters:

path – Path where to extract the archive to.

classmethod get_supported_archives()[source]
class rebasehelper.archive.ArchiveTypeBase[source]

Base class for various archive types

EXTENSION: str = ''
classmethod extract(archive, filename, path)[source]

Extracts the archive into the given path

Parameters:

path – Path where to extract the archive to.

Returns:

classmethod match(filename)[source]

Checks if the filename matches the archive type. If yes, returns True, otherwise returns False.

classmethod open(filename)[source]

Opens archive with the given filename and returns the proper archive type object.

class rebasehelper.archive.Bz2ArchiveType[source]
EXTENSION: str = '.bz2'
class rebasehelper.archive.CrateArchiveType[source]
EXTENSION: str = '.crate'
class rebasehelper.archive.GemArchiveType[source]
EXTENSION: str = '.gem'
class GemArchive(filename)[source]
close()[source]
extract(path)[source]
classmethod extract(archive, filename, path)[source]

Extracts the archive into the given path

Parameters:

path – Path where to extract the archive to.

Returns:

classmethod open(filename)[source]

Opens archive with the given filename and returns the proper archive type object.

class rebasehelper.archive.TarArchiveType[source]
EXTENSION: str = '.tar'
class rebasehelper.archive.TarBz2ArchiveType[source]
EXTENSION: str = '.tar.bz2'
classmethod extract(archive, filename, path)[source]

Extracts the archive into the given path

Parameters:

path – Path where to extract the archive to.

Returns:

classmethod open(filename)[source]

Opens archive with the given filename and returns the proper archive type object.

class rebasehelper.archive.TarGzArchiveType[source]
EXTENSION: str = '.tar.gz'
classmethod extract(archive, filename, path)[source]

Extracts the archive into the given path

Parameters:

path – Path where to extract the archive to.

Returns:

classmethod open(filename)[source]

Opens archive with the given filename and returns the proper archive type object.

class rebasehelper.archive.TarXzArchiveType[source]
EXTENSION: str = '.tar.xz'
classmethod extract(archive, filename, path)[source]

Extracts the archive into the given path

Parameters:

path – Path where to extract the archive to.

Returns:

classmethod open(filename)[source]

Opens archive with the given filename and returns the proper archive type object.

class rebasehelper.archive.TgzArchiveType[source]
EXTENSION: str = '.tgz'
class rebasehelper.archive.ZipArchiveType[source]
EXTENSION: str = '.zip'
classmethod extract(archive, filename, path)[source]

Extracts the archive into the given path

Parameters:

path – Path where to extract the archive to.

Returns:

classmethod match(filename)[source]

Checks if the filename matches the archive type. If yes, returns True, otherwise returns False.

classmethod open(filename)[source]

Opens archive with the given filename and returns the proper archive type object.

rebasehelper.archive.register_archive_type(archive)[source]