less copy protection, more size visualization
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

12 lines
334 B

  1. import sys
  2. import re
  3. from pathlib import Path
  4. for path in Path(sys.argv[1]).rglob('*.svg'):
  5. with open(path, "r") as file:
  6. data = file.read()
  7. if "<g>" not in data:
  8. data = data.replace("</style>", "</style><g>").replace("</svg>", "</g></svg>")
  9. with open(path, "w") as file:
  10. file.write(data)