diff options
Diffstat (limited to 'module/network')
-rw-r--r-- | module/network/Browser.py | 2 | ||||
-rw-r--r-- | module/network/Bucket.py | 2 | ||||
-rw-r--r-- | module/network/HTTPChunk.py | 8 | ||||
-rw-r--r-- | module/network/HTTPDownload.py | 8 | ||||
-rw-r--r-- | module/network/RequestFactory.py | 2 | ||||
-rw-r--r-- | module/network/XDCCRequest.py | 2 |
6 files changed, 12 insertions, 12 deletions
diff --git a/module/network/Browser.py b/module/network/Browser.py index 3452184d8..9cf6c2f30 100644 --- a/module/network/Browser.py +++ b/module/network/Browser.py @@ -16,7 +16,7 @@ class Browser(object): self.options = options #holds pycurl options self.bucket = bucket - self.cj = None # needs to be setted later + self.cj = None # needs to be set later self._size = 0 self.renewHTTPRequest() diff --git a/module/network/Bucket.py b/module/network/Bucket.py index ff80bda55..db67faa4a 100644 --- a/module/network/Bucket.py +++ b/module/network/Bucket.py @@ -39,7 +39,7 @@ class Bucket: self.lock.release() def consumed(self, amount): - """ return time the process have to sleep, after consumed specified amount """ + """ return the time the process has to sleep, after it consumed a specified amount """ if self.rate < MIN_RATE: return 0 #May become unresponsive otherwise self.lock.acquire() diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py index 3380fb733..d17177ee7 100644 --- a/module/network/HTTPChunk.py +++ b/module/network/HTTPChunk.py @@ -207,7 +207,7 @@ class HTTPChunk(HTTPRequest): def writeHeader(self, buf): self.header += buf - #@TODO forward headers?, this is possibly unneeeded, when we just parse valid 200 headers + #@TODO forward headers?, this is possibly unneeded, when we just parse valid 200 headers # as first chunk, we will parse the headers if not self.range and self.header.endswith("\r\n\r\n"): self.parseHeader() @@ -236,8 +236,8 @@ class HTTPChunk(HTTPRequest): sleep(self.p.bucket.consumed(size)) else: # Avoid small buffers, increasing sleep time slowly if buffer size gets smaller - # otherwise reduce sleep time percentual (values are based on tests) - # So in general cpu time is saved without reducing bandwith too much + # otherwise reduce sleep time percentile (values are based on tests) + # So in general cpu time is saved without reducing bandwidth too much if size < self.lastSize: self.sleep += 0.002 @@ -253,7 +253,7 @@ class HTTPChunk(HTTPRequest): def parseHeader(self): - """parse data from recieved header""" + """parse data from received header""" for orgline in self.decodeResponse(self.header).splitlines(): line = orgline.strip().lower() if line.startswith("accept-ranges") and "bytes" in line: diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py index 05ca44406..c6d2e1547 100644 --- a/module/network/HTTPDownload.py +++ b/module/network/HTTPDownload.py @@ -34,7 +34,7 @@ from module.utils.fs import save_join, fs_encode # TODO: save content-disposition for resuming class HTTPDownload(): - """ loads a url http + ftp """ + """ loads an url, http + ftp supported """ def __init__(self, url, filename, get={}, post={}, referer=None, cj=None, bucket=None, options={}, progressNotify=None, disposition=False): @@ -174,7 +174,7 @@ class HTTPDownload(): while 1: #need to create chunks - if not chunksCreated and self.chunkSupport and self.size: #will be setted later by first chunk + if not chunksCreated and self.chunkSupport and self.size: #will be set later by first chunk if not resume: self.info.setSize(self.size) @@ -193,7 +193,7 @@ class HTTPDownload(): self.chunks.append(c) self.m.add_handle(handle) else: - #close immediatly + #close immediately self.log.debug("Invalid curl handle -> closed") c.close() @@ -291,7 +291,7 @@ class HTTPDownload(): if self.abort: raise Abort() - #sleep(0.003) #supress busy waiting - limits dl speed to (1 / x) * buffersize + #sleep(0.003) #suppress busy waiting - limits dl speed to (1 / x) * buffersize self.m.select(1) for chunk in self.chunks: diff --git a/module/network/RequestFactory.py b/module/network/RequestFactory.py index 12fd66c95..932184678 100644 --- a/module/network/RequestFactory.py +++ b/module/network/RequestFactory.py @@ -46,7 +46,7 @@ class RequestFactory(): return req def getHTTPRequest(self, **kwargs): - """ returns a http request, dont forget to close it ! """ + """ returns a http request, don't forget to close it ! """ options = self.getOptions() options.update(kwargs) # submit kwargs as additional options return HTTPRequest(CookieJar(None), options) diff --git a/module/network/XDCCRequest.py b/module/network/XDCCRequest.py index f03798c17..7a1a98cb5 100644 --- a/module/network/XDCCRequest.py +++ b/module/network/XDCCRequest.py @@ -119,7 +119,7 @@ class XDCCRequest(): fh.write(data) - # acknowledge data by sending number of recceived bytes + # acknowledge data by sending number of received bytes dccsock.send(struct.pack('!I', self.recv)) dccsock.close() |