Files
  • main.py
  • main.css
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python3

"""
    Append a semicolon to CSS
"""

with open("main.css") as css:
    for line in css:

        if line.isspace():
            pass

        if line.strip().endswith("{"):
            pass

        if line.strip().startswith("}"):
            pass

        if line.strip().startswith("/*"):
            pass

        if line.strip().endswith(";"):
            pass

        else:
            line = line + ";"

        with open("css.new", "a+") as new:

            new.write(line)