Skip to content

Commit 656632c

Browse files
committed
Update python script
1 parent 67a3518 commit 656632c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

build.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import os
22
import shutil
33

4+
from html.parser import HTMLParser
5+
6+
7+
class _HTMLParser(HTMLParser):
8+
def handle_starttag(self, tag, attrs):
9+
print("HTML Tag:", tag, attrs, sep="\n ")
10+
11+
412
for dir, subdirs, files in os.walk("./www"):
513
if (not subdirs and not files) or (
614
all([file.startswith(".") for file in files])
@@ -13,3 +21,12 @@
1321
if file.startswith(".") or file.endswith(".ts"):
1422
os.remove(os.path.join(dir, file))
1523
continue
24+
25+
if file.endswith(".html"):
26+
try:
27+
p = _HTMLParser()
28+
p.feed(open(os.path.join(dir, file), "rb").read().decode())
29+
p.close()
30+
print(os.path.join(dir, file), "SUCCESS")
31+
except Exception as e:
32+
print(os.path.join(dir, file), e)

0 commit comments

Comments
 (0)