diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2015-07-08 11:28:44 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2015-07-08 11:28:44 +0200 |
commit | 5e4cd2c12efe25668e997738af0d5c0b48b88ed3 (patch) | |
tree | 1046ae06251dd09a847494420f892df1ab7a0966 | |
parent | 7a980c043bf30e574a93882eb6adb03a796e2a74 (diff) | |
download | NetworkManager-5e4cd2c12efe25668e997738af0d5c0b48b88ed3.tar.gz |
contrib/rh-bkr: decompress mainpage if it's gzipped
Will be useful for compressed rpmmd.
-rwxr-xr-x | contrib/rh-bkr/bkr.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/rh-bkr/bkr.py b/contrib/rh-bkr/bkr.py index 5c6bb18288..3125561dc2 100755 --- a/contrib/rh-bkr/bkr.py +++ b/contrib/rh-bkr/bkr.py @@ -383,6 +383,12 @@ class UploadFile_ParseWebsite(UploadFile): page = p.read() p.close() + if re.match('.*\.gz$', self._mainpage): + import gzip, StringIO + p = StringIO.StringIO(page) + page = gzip.GzipFile(fileobj=p).read() + p.close() + urls = list(self.parse_urls(page)) if not urls: self.raise_no_urls() |