|
- import sys
- import re
-
- from pathlib import Path
-
- for path in Path(sys.argv[1]).rglob('*.svg'):
- with open(path, "r") as file:
- data = file.read()
- if "<g>" not in data:
- data = data.replace("</style>", "</style><g>").replace("</svg>", "</g></svg>")
- with open(path, "w") as file:
- file.write(data)
|