From 5c9de3183586a5faea856ed7291895fb47f882bd Mon Sep 17 00:00:00 2001 From: jenz Date: Fri, 13 Sep 2024 15:16:44 +0200 Subject: [PATCH] accidentaly uploaded wrong content --- .../lowercase_res_content.py | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/fastdl_sync/svencoop_lowercasing/lowercase_res_content.py b/fastdl_sync/svencoop_lowercasing/lowercase_res_content.py index 28c154d7..dbbc880c 100644 --- a/fastdl_sync/svencoop_lowercasing/lowercase_res_content.py +++ b/fastdl_sync/svencoop_lowercasing/lowercase_res_content.py @@ -1,16 +1,15 @@ -#!/bin/bash +#!/usr/bin/python3 -to_lowercase() { - find "$1" -depth -execdir rename 's/(.*)/\L$1/' {} + - ./lowercase_res_content.py -} +from pathlib import Path -to_lowercase "./svencoop_addon" - -inotifywait -m -r -e create -e moved_to -e modify --format '%w%f' "./svencoop_addon" | while read NEWFILE -do - echo "File change: $NEWFILE" - to_lowercase "./svencoop_addon" - sleep 1 -done +#we just lowercase each line in each res file so fastdl is fine with everything being lowercase. +def main(): + for p in Path("./svencoop_addon/maps/").glob('*.res'): #get all .res files in /maps + with open(p, 'r') as res: + lines = res.readlines() + with open(p, 'w') as res: + for line in lines: + res.write(line.lower()) +if __name__ == "__main__": + main()