import os

find_and_replace_mappings = {
    "inkscape:": "inkscape",
    "rdf:": "rdf",
    "dc:": "dc",
    "cc:": "cc",
    "xmlns:": "xmlns",
    "sodipodi:": "sodipodi"
}

SVG_PATH = "./assets/img/habitatSVG/"

for filename in os.listdir(SVG_PATH):
    if filename.endswith(".svg"):
        print(f"Processing {filename}")
        with open (f"{SVG_PATH}{filename}", "r") as myfile:
            data=myfile.read()

            for find_val, replace_val in find_and_replace_mappings.items():
                data = data.replace(find_val, replace_val)
        
        with open (f"{SVG_PATH}{filename}", "w") as myfile:
            myfile.write(data)
