summaryrefslogtreecommitdiffstats
path: root/pyload/network/HTTPChunk.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/network/HTTPChunk.py')
-rw-r--r--pyload/network/HTTPChunk.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/pyload/network/HTTPChunk.py b/pyload/network/HTTPChunk.py
index c11ad9e3c..82e1ca76e 100644
--- a/pyload/network/HTTPChunk.py
+++ b/pyload/network/HTTPChunk.py
@@ -86,7 +86,7 @@ class ChunkInfo(object):
ci.loaded = True
ci.setSize(size)
while True:
- if not fh.readline(): #skip line
+ if not fh.readline(): #: skip line
break
name = fh.readline()[1:-1]
range = fh.readline()[1:-1]
@@ -122,8 +122,8 @@ class HTTPChunk(HTTPRequest):
def __init__(self, id, parent, range=None, resume=False):
self.id = id
- self.p = parent # HTTPDownload instance
- self.range = range # tuple (start, end)
+ self.p = parent #: HTTPDownload instance
+ self.range = range #: tuple (start, end)
self.resume = resume
self.log = parent.log
@@ -134,14 +134,14 @@ class HTTPChunk(HTTPRequest):
self.c = pycurl.Curl()
self.header = ""
- self.headerParsed = False #indicates if the header has been processed
+ self.headerParsed = False #: indicates if the header has been processed
- self.fp = None #file handle
+ self.fp = None #: file handle
self.initHandle()
self.setInterface(self.p.options)
- self.BOMChecked = False # check and remove byte order mark
+ self.BOMChecked = False #: check and remove byte order mark
self.rep = None
@@ -175,10 +175,10 @@ class HTTPChunk(HTTPRequest):
self.arrived = stat(fs_name).st_size
if self.range:
- #do nothing if chunk already finished
+ # do nothing if chunk already finished
if self.arrived + self.range[0] >= self.range[1]: return None
- if self.id == len(self.p.info.chunks) - 1: #as last chunk dont set end range, so we get everything
+ if self.id == len(self.p.info.chunks) - 1: #: as last chunk dont set end range, so we get everything
range = "%i-" % (self.arrived + self.range[0])
else:
range = "%i-%i" % (self.arrived + self.range[0], min(self.range[1] + 1, self.p.size - 1))
@@ -191,7 +191,7 @@ class HTTPChunk(HTTPRequest):
else:
if self.range:
- if self.id == len(self.p.info.chunks) - 1: # see above
+ if self.id == len(self.p.info.chunks) - 1: #: see above
range = "%i-" % self.range[0]
else:
range = "%i-%i" % (self.range[0], min(self.range[1] + 1, self.p.size - 1))
@@ -249,7 +249,7 @@ class HTTPChunk(HTTPRequest):
sleep(self.sleep)
if self.range and self.arrived > self.size:
- return 0 #close if we have enough data
+ return 0 #: close if we have enough data
def parseHeader(self):
@@ -300,8 +300,8 @@ class HTTPChunk(HTTPRequest):
def flushFile(self):
""" flush and close file """
self.fp.flush()
- fsync(self.fp.fileno()) #make sure everything was written to disk
- self.fp.close() #needs to be closed, or merging chunks will fail
+ fsync(self.fp.fileno()) #: make sure everything was written to disk
+ self.fp.close() #: needs to be closed, or merging chunks will fail
def close(self):