Skip to content

Commit d1a6655

Browse files
committed
re-wrapped longer comments, added doc string, and organized imports
1 parent 48e2f5b commit d1a6655

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

scripts/deduplicate.py

+18-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
import sys
2-
import traceback
3-
import os
1+
#!/usr/bin/env python3
2+
# vim: set fileencoding=utf-8:
3+
4+
"""
5+
Deduplicate the files in www/l by moving unique files up a level and symlinking
6+
to them
7+
"""
8+
9+
# Standard library
410
from pathlib import Path
5-
import hashlib
611
from shutil import copyfile
12+
import hashlib
13+
import os
14+
import sys
15+
import traceback
16+
717

818
EURO = [
919
"b9f4175382a404007e19d3566061e36c",
@@ -45,8 +55,8 @@ def main():
4555
relative = Path(f).relative_to(path)
4656

4757
# Joins the first and last part of the file parts
48-
# so it can be used moving the file to the parent license folder
49-
# because some files are under 2 sub-directories.
58+
# so it can be used moving the file to the parent license
59+
# folder because some files are under 2 sub-directories.
5060
# by-nc/1.0/80x15.png --> by-nc - first
5161
# x 1.0
5262
# --> 80x15.png - last
@@ -56,8 +66,8 @@ def main():
5666
)
5767
)
5868

59-
# If the file contains an euro symbol, add -e tag to the end of file
60-
# to avoid the overwriting.
69+
# If the file contains an euro symbol, add -e tag to the end of
70+
# the file to avoid the overwriting.
6171
if digest in EURO:
6272
parent = Path(str(parent).replace(".png", "-e.png"))
6373

0 commit comments

Comments
 (0)