Run black on all Python scripts!

This commit is contained in:
Geoffrey Frogeye 2021-06-13 11:49:21 +02:00
parent fb6cfce656
commit cd9cbcaa28
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
30 changed files with 1027 additions and 704 deletions

View file

@ -16,17 +16,17 @@ def main() -> None:
"""
Function that executes the script.
"""
for root, _, files in os.walk('.'):
for root, _, files in os.walk("."):
for filename in files:
match = re.match(r'^(\d+) - (.+)$', filename)
match = re.match(r"^(\d+) - (.+)$", filename)
if not match:
continue
new_filename = f"{match[1]} {match[2]}"
old_path = os.path.join(root, filename)
new_path = os.path.join(root, new_filename)
print(old_path, '->', new_path)
print(old_path, "->", new_path)
os.rename(old_path, new_path)
if __name__ == '__main__':
if __name__ == "__main__":
main()