-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.py
59 lines (44 loc) ยท 1.57 KB
/
update.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python
import os
from urllib import parse
HEADER="""#
# ๋ฐฑ์ค & ํ๋ก๊ทธ๋๋จธ์ค ๋ฌธ์ ํ์ด ๋ชฉ๋ก
ํ๋ก๊ทธ๋๋จธ์ค์ ๊ฒฝ์ฐ, ํผ ๋ฌธ์ ๋ชฉ๋ก์ ๋ํ ๋ง์ด๊ทธ๋ ์ด์
์ด ํ์ํฉ๋๋ค.
"""
def main():
content = ""
content += HEADER
directories = [];
solveds = [];
for root, dirs, files in os.walk("."):
dirs.sort()
if root == '.':
for dir in ('.git', '.github'):
try:
dirs.remove(dir)
except ValueError:
pass
continue
category = os.path.basename(root)
if category == 'images':
continue
directory = os.path.basename(os.path.dirname(root))
if directory == '.':
continue
if directory not in directories:
if directory in ["๋ฐฑ์ค", "ํ๋ก๊ทธ๋๋จธ์ค"]:
content += "## ๐ {}\n".format(directory)
else:
content += "### ๐ {}\n".format(directory)
content += "| ๋ฌธ์ ๋ฒํธ | ๋งํฌ |\n"
content += "| ----- | ----- |\n"
directories.append(directory)
for file in files:
if category not in solveds:
content += "|{}|[๋งํฌ]({})|\n".format(category, parse.quote(os.path.join(root, file)))
solveds.append(category)
print("category : " + category)
with open("README.md", "w") as fd:
fd.write(content)
if __name__ == "__main__":
main()