diff options
Diffstat (limited to 'module/network/HTTPChunk.py')
-rw-r--r-- | module/network/HTTPChunk.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py index b637aef32..719c3ed0b 100644 --- a/module/network/HTTPChunk.py +++ b/module/network/HTTPChunk.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- """ This program is free software; you can redistribute it and/or modify @@ -13,7 +12,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. - + @author: RaNaN """ from os import remove, stat, fsync @@ -30,7 +29,7 @@ class WrongFormat(Exception): pass -class ChunkInfo(): +class ChunkInfo: def __init__(self, name): self.name = unicode(name) self.size = 0 @@ -208,7 +207,7 @@ class HTTPChunk(HTTPRequest): # as first chunk, we will parse the headers if not self.range and self.header.endswith("\r\n\r\n"): self.parseHeader() - elif not self.range and buf.startswith("150") and "data connection" in buf: #ftp file size parsing + elif not self.range and buf.startswith("150") and "data connection" in buf.lower(): #: ftp file size parsing size = search(r"(\d+) bytes", buf) if size: self.p.size = int(size.group(1)) @@ -269,7 +268,7 @@ class HTTPChunk(HTTPRequest): def stop(self): """The download will not proceed after next call of writeBody""" - self.range = [0,0] + self.range = [0, 0] self.size = 0 def resetRange(self): @@ -290,4 +289,4 @@ class HTTPChunk(HTTPRequest): """ closes everything, unusable after this """ if self.fp: self.fp.close() self.c.close() - if hasattr(self, "p"): del self.p
\ No newline at end of file + if hasattr(self, "p"): del self.p |