-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
29 lines (24 loc) · 951 Bytes
/
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
"""
Criteria this function needs to meet to get tot badge
1. Its survival time should be above a threshold (365 days at the time of creating this repo)
2. Dev Eq of its firt commit should be above a threshold (25 at the time of creating this repo)
3. The sum of Dev Eq of subsequent commits should be less than 10% of that of the first commit.
"""
import os
import stat
import shutil
def main(top):
"""the content of this function is irelevant, just piling code to get to the Dev Eq threshold"""
if os.name != "nt":
shutil.rmtree(top)
return
for root, dirs, files in os.walk(top, topdown=False):
for name in files:
filename = os.path.join(root, name)
os.chmod(filename, stat.S_IWUSR)
os.remove(filename)
for name in dirs:
os.rmdir(os.path.join(root, name))
os.rmdir(top)
# this is needed since we require in-degree + out-degree > 0
main()