Reduce indentation

main
Jaap Joris Vens 2020-09-13 23:16:38 +02:00
rodzic 43c4cd281c
commit 3c8d5f6afe
1 zmienionych plików z 10 dodań i 11 usunięć

Wyświetl plik

@ -32,17 +32,16 @@ class SassMiddleware:
css_file = request.path.rsplit('/',1)[1]
sass_file = css_file[:-4]
sass_paths = locate(sass_file)
if sass_paths:
for sass_path in sass_paths:
if os.path.exists(sass_path):
css_path = sass_path + '.css'
map_path = css_path + '.map'
css = compile(filename=sass_path, output_style='nested')
css, mapping = compile(filename=sass_path, source_map_filename=map_path)
with open(css_path, 'w') as f:
f.write(css)
with open(map_path, 'w') as f:
f.write(mapping)
for sass_path in list(sass_paths):
if os.path.exists(sass_path):
css_path = sass_path + '.css'
map_path = css_path + '.map'
css = compile(filename=sass_path, output_style='nested')
css, mapping = compile(filename=sass_path, source_map_filename=map_path)
with open(css_path, 'w') as f:
f.write(css)
with open(map_path, 'w') as f:
f.write(mapping)
response = self.get_response(request)
return response