dvc: use black instead of flake8

Fixes #1546

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2019-01-30 03:48:36 +02:00
parent b5c3a14edf
commit 4069e34130
111 changed files with 4200 additions and 4181 deletions
+1 -1
View File
@@ -14,5 +14,5 @@ def spy(method_to_decorate):
def load_stage_file(path):
with open(path, 'r') as fobj:
with open(path, "r") as fobj:
return yaml.safe_load(fobj)
+9 -9
View File
@@ -10,9 +10,9 @@ class ETagHandler(SimpleHTTPRequestHandler):
file = self.translate_path(self.path)
if not os.path.isdir(file) and os.path.exists(file):
with open(file, 'r') as fd:
etag = hashlib.md5(fd.read().encode('utf8')).hexdigest()
self.send_header('ETag', etag)
with open(file, "r") as fd:
etag = hashlib.md5(fd.read().encode("utf8")).hexdigest()
self.send_header("ETag", etag)
SimpleHTTPRequestHandler.end_headers(self)
@@ -22,9 +22,9 @@ class ContentMD5Handler(SimpleHTTPRequestHandler):
file = self.translate_path(self.path)
if not os.path.isdir(file) and os.path.exists(file):
with open(file, 'r') as fd:
md5 = hashlib.md5(fd.read().encode('utf8')).hexdigest()
self.send_header('Content-MD5', md5)
with open(file, "r") as fd:
md5 = hashlib.md5(fd.read().encode("utf8")).hexdigest()
self.send_header("Content-MD5", md5)
SimpleHTTPRequestHandler.end_headers(self)
@@ -32,11 +32,11 @@ class ContentMD5Handler(SimpleHTTPRequestHandler):
class StaticFileServer:
__server_lock = threading.Lock()
def __init__(self, handler='etag'):
handler_class = ETagHandler if handler == 'etag' else ContentMD5Handler
def __init__(self, handler="etag"):
handler_class = ETagHandler if handler == "etag" else ContentMD5Handler
self.__server_lock.acquire()
self.httpd = HTTPServer(('localhost', 8000), handler_class)
self.httpd = HTTPServer(("localhost", 8000), handler_class)
def __enter__(self):
self.server_thread = threading.Thread(target=self.httpd.serve_forever)