Archive module

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

Class representing an archive with sources

extract_archive(path=None)[source]

Extracts the archive into the given path

Parameters:path – Path where to extract the archive to.
Returns:
classmethod get_supported_archives()[source]

Return list of supported archive types

class rebasehelper.archive.ArchiveTypeBase[source]

Base class for various archive types

EXTENSION = ''
classmethod extract(filename=None, *args, **kwargs)[source]

Extracts the archive into the given path

Parameters:path – Path where to extract the archive to.
Returns:
classmethod match(filename=None, *args, **kwargs)[source]

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

classmethod open(filename=None, *args, **kwargs)[source]

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

class rebasehelper.archive.Bz2ArchiveType[source]

.bz2 archive type

EXTENSION = '.bz2'
classmethod extract(archive=None, filename=None, path=None, *args, **kwargs)[source]
classmethod open(filename=None)[source]
class rebasehelper.archive.GemPseudoArchiveType[source]

.gem files are not archives - this is a pseudo type

EXTENSION = '.gem'
classmethod extract(archive=None, filename=None, path=None, *args, **kwargs)[source]
classmethod open(filename=None)[source]
class rebasehelper.archive.TarBz2ArchiveType[source]

.tar.bz2 archive type

EXTENSION = '.tar.bz2'
class rebasehelper.archive.TarGzArchiveType[source]

.tar.gz archive type

EXTENSION = '.tar.gz'
classmethod extract(archive=None, filename=None, path=None, *args, **kwargs)[source]
classmethod open(filename=None)[source]
class rebasehelper.archive.TarXzArchiveType[source]

.tar.xz archive type

EXTENSION = '.tar.xz'
classmethod extract(archive=None, filename=None, path=None, *args, **kwargs)[source]
classmethod open(filename=None)[source]
class rebasehelper.archive.TgzArchiveType[source]

.tgz archive type

EXTENSION = '.tgz'
class rebasehelper.archive.ZipArchiveType[source]

.zip archive type

EXTENSION = '.zip'
classmethod extract(archive=None, filename=None, path=None, *args, **kwargs)[source]
classmethod match(filename=None)[source]
classmethod open(filename=None)[source]
rebasehelper.archive.register_archive_type(archive)[source]