log format

This commit is contained in:
j 2016-01-24 15:35:43 +05:30
parent d70bd8797a
commit 35c0c02d16
2 changed files with 3 additions and 2 deletions

View file

@ -138,6 +138,7 @@ class Handler(http.server.SimpleHTTPRequestHandler):
data = b'404 - Not Found'
self.send_header('Content-Length', str(len(data)))
self.end_headers()
# FIXME: also check for limit here
self.wfile.write(data)
return
path = i.get_path()

View file

@ -350,15 +350,15 @@ class Node(Thread):
return False
def download_preview(self, item_id):
logger.debug('trying to download preview from %s for %s', self.url, item_id)
from item.icons import icons
self.resolve()
logger.debug('download preview for %s from %s', item_id, self.url)
url = '%s/preview/%s' % (self.url, item_id)
self._opener.addheaders = list(zip(self.headers.keys(), self.headers.values()))
try:
r = self._opener.open(url, timeout=self.TIMEOUT*2)
except:
logger.debug('openurl failed %s', url, exc_info=True)
logger.debug('download failed %s', url, exc_info=True)
return False
code = r.getcode()
if code == 200: