display gzip errors
This commit is contained in:
parent
f56aab091e
commit
fe5da620b2
1 changed files with 8 additions and 3 deletions
|
@ -1,6 +1,8 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# -*- Mode: Python; -*-
|
# -*- Mode: Python; -*-
|
||||||
# vi:si:et:sw=2:sts=2:ts=2
|
# vi:si:et:sw=2:sts=2:ts=2
|
||||||
|
import gzip
|
||||||
|
import StringIO
|
||||||
|
|
||||||
from sqlobject import *
|
from sqlobject import *
|
||||||
from turbogears.database import PackageHub
|
from turbogears.database import PackageHub
|
||||||
|
@ -58,8 +60,11 @@ class Archive(SQLObject):
|
||||||
try:
|
try:
|
||||||
result = getUrl(url)
|
result = getUrl(url)
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
print e.code
|
print "ERROR:", e.code
|
||||||
print e.read()
|
data = e.read()
|
||||||
|
if e.headers.get('content-encoding', None) == 'gzip':
|
||||||
|
data = gzip.GzipFile(fileobj=StringIO.StringIO(data)).read()
|
||||||
|
print data
|
||||||
raise
|
raise
|
||||||
except:
|
except:
|
||||||
import traceback
|
import traceback
|
||||||
|
@ -199,7 +204,7 @@ class Archive(SQLObject):
|
||||||
- sync get list from frontend and remove/add those that are not in sync
|
- sync get list from frontend and remove/add those that are not in sync
|
||||||
'''
|
'''
|
||||||
def updateFrontend(self):
|
def updateFrontend(self):
|
||||||
for f in ArchiveFile.select(ArchiveFile.modified >= self.published):
|
for f in ArchiveFile.select(ArchiveFile.q.published >= self.published):
|
||||||
self.notifyFrontend('add', f.md5sum)
|
self.notifyFrontend('add', f.md5sum)
|
||||||
self.published=datetime.now()
|
self.published=datetime.now()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue