Update, 2024-01-16

This commit is contained in:
Aarni Koskela
2024-01-16 09:30:18 +02:00
parent e2853e8910
commit fbfb1c2eb9
122 changed files with 58 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.py[cod]

57
_scripts/update.py Normal file
View File

@@ -0,0 +1,57 @@
import argparse
import os
import shutil
import unicodedata
REPO_PATH = os.path.join(os.path.dirname(__file__), "..")
BUCKETS = {
"abcdefghi": "a-i",
"jklmnopqr": "j-r",
"stuvwxyz": "s-z",
}
def find_bucket(name: str) -> str:
initial = name[0].lower()
for letters, test_bucket in BUCKETS.items():
if initial in letters:
return test_bucket
return "other"
def main():
ap = argparse.ArgumentParser()
ap.add_argument("-s", "--source", help="Source path for files", required=True)
ap.add_argument(
"-d", "--dest", help="Destination path for files", default=REPO_PATH
)
ap.add_argument("-n", "--dry-run", help="Dry run", action="store_true")
args = ap.parse_args()
buckets = set()
with os.scandir(args.source) as it:
for entry in it:
name = entry.name
if entry.is_file():
bucket = find_bucket(name)
buckets.add(bucket)
name_norm = unicodedata.normalize("NFC", name).lower()
dest = os.path.join(args.dest, bucket, name_norm)
if args.dry_run:
print(f"Would copy {entry.path} to {dest}")
else:
os.makedirs(os.path.dirname(dest), exist_ok=True)
shutil.copyfile(entry.path, dest)
print(f"Copied {name} to {dest}")
else:
print(f"Skipping {name}")
for bucket in buckets:
dest = os.path.join(args.dest, bucket)
if os.path.isdir(dest):
n_files = len(os.listdir(dest))
if n_files > 900:
print(f"Bucket {bucket} has more than 900 files, please split it")
if __name__ == "__main__":
main()

BIN
a-i/antspaar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
a-i/asko_vilenius.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
a-i/atp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

BIN
a-i/betteridge.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
a-i/blob-hearteyes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
a-i/bloody_popcorn.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

BIN
a-i/bong.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
a-i/bontho.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

BIN
a-i/budanov.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
a-i/catgun.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
a-i/chainsaw.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
a-i/chydenius.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
a-i/climatechange.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
a-i/climatecrisis.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

BIN
a-i/code-of-conduct.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
a-i/cool-story-bro.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
a-i/csharp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

BIN
a-i/data-clinic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

File diff suppressed because one or more lines are too long

BIN
a-i/dota.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

BIN
a-i/evilshit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
a-i/excuse-me.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

BIN
a-i/expected.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
a-i/fastest-parrot.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
a-i/feelthekk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
a-i/fennoa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
a-i/festool.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

BIN
a-i/funikulaari.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

BIN
a-i/gold-bar.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
a-i/hatsoff.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

BIN
a-i/heisenberg.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

BIN
a-i/hese.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
a-i/homerhide.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

BIN
a-i/icq.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
a-i/its-a-trap.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
j-r/karjakko.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
j-r/kill_it_with_fire.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
j-r/kiss-my-turku.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
j-r/kummola.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
j-r/lahti.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
j-r/legacymale.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

BIN
j-r/maffe-sillassa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
j-r/meow-fingerguns.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

BIN
j-r/more.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
j-r/muia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
j-r/neat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

BIN
j-r/nice-text-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
j-r/nice-text-2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
j-r/nice.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
j-r/no-french-fries.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
j-r/northcode.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
j-r/nyökytys.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

BIN
j-r/oulu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

BIN
j-r/oven_bake.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
j-r/parikpatel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
j-r/patriklaine.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
j-r/pcmasterrace.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

BIN
j-r/please.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

BIN
j-r/rahka.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

BIN
s-z/shining-frozen.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

BIN
s-z/stalin-point.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1016 B

BIN
s-z/tapina.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Some files were not shown because too many files have changed in this diff Show More