diff options
author | Olav Vitters <olav@vitters.nl> | 2015-01-26 14:36:08 +0100 |
---|---|---|
committer | Olav Vitters <olav@vitters.nl> | 2015-01-26 14:36:08 +0100 |
commit | cdb2cc955da8ae4f07df281f02357466150d5290 (patch) | |
tree | 4d80b12447214cdf43eddfc9a9cd9deefcfa68b9 | |
parent | b2217184cb9d12220792398f0c485f60cc983b3b (diff) | |
download | mgagnome-cdb2cc955da8ae4f07df281f02357466150d5290.tar mgagnome-cdb2cc955da8ae4f07df281f02357466150d5290.tar.gz mgagnome-cdb2cc955da8ae4f07df281f02357466150d5290.tar.bz2 mgagnome-cdb2cc955da8ae4f07df281f02357466150d5290.tar.xz mgagnome-cdb2cc955da8ae4f07df281f02357466150d5290.zip |
remove unused code
-rwxr-xr-x | mgagnome | 40 |
1 files changed, 0 insertions, 40 deletions
@@ -22,12 +22,6 @@ import shutil # version comparison: import rpm -# opening tarballs: -import tarfile -import gzip -import bz2 -import lzma # pyliblzma - # getting links from HTML document: from html.parser import HTMLParser import urllib.request, urllib.error, urllib.parse @@ -284,40 +278,6 @@ class urllister(HTMLParser): if href: self.urls.extend(href) -class XzTarFile(tarfile.TarFile): - - OPEN_METH = tarfile.TarFile.OPEN_METH.copy() - OPEN_METH["xz"] = "xzopen" - - @classmethod - def xzopen(cls, name, mode="r", fileobj=None, **kwargs): - """Open gzip compressed tar archive name for reading or writing. - Appending is not allowed. - """ - if len(mode) > 1 or mode not in "rw": - raise ValueError("mode must be 'r' or 'w'") - - if fileobj is not None: - fileobj = _LMZAProxy(fileobj, mode) - else: - fileobj = lzma.LZMAFile(name, mode) - - try: - # lzma doesn't immediately return an error - # try and read a bit of data to determine if it is a valid xz file - fileobj.read(_LZMAProxy.blocksize) - fileobj.seek(0) - t = cls.taropen(name, mode, fileobj, **kwargs) - except IOError: - raise tarfile.ReadError("not a xz file") - except lzma.error: - raise tarfile.ReadError("not a xz file") - t._extfileobj = False - return t - -if not hasattr(tarfile.TarFile, 'xzopen'): - tarfile.open = XzTarFile.open - def is_valid_hash(path, algo, hexdigest): if algo not in hashlib.algorithms_available: raise ValueError("Unknown hash algorithm: %s" % algo) |