Files
  • main.py
  • css.new
  • main.css
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python3

"""
    Append a semicolon to CSS
"""

with open("main.css") as css, open("css.new", "w") as new:
    for line in css:
        line = line.rstrip()

        if len(line) == 0:
            pass
        elif not any(line.endswith(x) for x in ("{", "}", "/*", ";")):
            line = line + ";"

        new.write(line + "\n")