summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Vitters <olav@vitters.nl>2015-01-26 14:36:08 +0100
committerOlav Vitters <olav@vitters.nl>2015-01-26 14:36:08 +0100
commitcdb2cc955da8ae4f07df281f02357466150d5290 (patch)
tree4d80b12447214cdf43eddfc9a9cd9deefcfa68b9
parentb2217184cb9d12220792398f0c485f60cc983b3b (diff)
downloadmgagnome-cdb2cc955da8ae4f07df281f02357466150d5290.tar
mgagnome-cdb2cc955da8ae4f07df281f02357466150d5290.tar.gz
mgagnome-cdb2cc955da8ae4f07df281f02357466150d5290.tar.bz2
mgagnome-cdb2cc955da8ae4f07df281f02357466150d5290.tar.xz
mgagnome-cdb2cc955da8ae4f07df281f02357466150d5290.zip
remove unused code
-rwxr-xr-xmgagnome40
1 files changed, 0 insertions, 40 deletions
diff --git a/mgagnome b/mgagnome
index 7fed651..c77f6d6 100755
--- a/mgagnome
+++ b/mgagnome
@@ -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)