Python function name underscores instead of camelcase

This commit is contained in:
Tushar Makkar 2016-11-11 17:25:14 +05:30
parent 6685d91729
commit 177a195752
1 changed files with 5 additions and 5 deletions

View File

@ -45,7 +45,7 @@ class FakeShutdownEvent(object):
""" """
@staticmethod @staticmethod
def isSet(): def is_set():
"Dummy method to always return false""" "Dummy method to always return false"""
return False return False
@ -435,7 +435,7 @@ def print_dots(current, total, start=False, end=False):
status status
""" """
if SHUTDOWN_EVENT.isSet(): if SHUTDOWN_EVENT.is_set():
return return
sys.stdout.write('.') sys.stdout.write('.')
@ -463,7 +463,7 @@ class HTTPDownloader(threading.Thread):
try: try:
if (timeit.default_timer() - self.starttime) <= self.timeout: if (timeit.default_timer() - self.starttime) <= self.timeout:
f = urlopen(self.request) f = urlopen(self.request)
while (not SHUTDOWN_EVENT.isSet() and while (not SHUTDOWN_EVENT.is_set() and
(timeit.default_timer() - self.starttime) <= (timeit.default_timer() - self.starttime) <=
self.timeout): self.timeout):
self.result.append(len(f.read(10240))) self.result.append(len(f.read(10240)))
@ -506,7 +506,7 @@ class HTTPUploaderData(object):
def read(self, n=10240): def read(self, n=10240):
if ((timeit.default_timer() - self.start) <= self.timeout and if ((timeit.default_timer() - self.start) <= self.timeout and
not SHUTDOWN_EVENT.isSet()): not SHUTDOWN_EVENT.is_set()):
chunk = self.data.read(n) chunk = self.data.read(n)
self.total.append(len(chunk)) self.total.append(len(chunk))
return chunk return chunk
@ -533,7 +533,7 @@ class HTTPUploader(threading.Thread):
request = self.request request = self.request
try: try:
if ((timeit.default_timer() - self.starttime) <= self.timeout and if ((timeit.default_timer() - self.starttime) <= self.timeout and
not SHUTDOWN_EVENT.isSet()): not SHUTDOWN_EVENT.is_set()):
try: try:
f = urlopen(request) f = urlopen(request)
except TypeError: except TypeError: