forked from devsapp/start-web-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.py
More file actions
67 lines (53 loc) · 1.95 KB
/
index.py
File metadata and controls
67 lines (53 loc) · 1.95 KB
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
60
61
62
63
64
65
66
67
import os
import yaml
applicationPaths = '''example/django-blog/
example/todolist-app/
web-framework/java/springboot
web-framework/nodejs/egg
web-framework/nodejs/express
web-framework/nodejs/hapi
web-framework/nodejs/koa
web-framework/nodejs/midway-koa
web-framework/nodejs/next
web-framework/nodejs/nuxt-ssr
web-framework/php/discuz
web-framework/php/ecshop
web-framework/php/laravel
web-framework/php/metinfo
web-framework/php/thinkphp
web-framework/php/typecho
web-framework/php/whatsns
web-framework/php/wordpress
web-framework/php/zblog
web-framework/python/bottle
web-framework/python/django
web-framework/python/fastapi
web-framework/python/flask
web-framework/python/pyramid
web-framework/python/tornado
web-framework/python/webpy'''
applicationPaths = applicationPaths.split("\n")
for eveApplication in applicationPaths:
with open(os.path.join(eveApplication, 'publish.yaml')) as f:
yamlContent = f.read()
publishyaml = yaml.safe_load(yamlContent)
applicationName = publishyaml['Name']
applicationDescription = publishyaml['Description']
applicationVersion = publishyaml['Version']
with open(os.path.join(eveApplication, 'readme.md')) as f:
tempReadmemd = f.read()
tempReadmemd = tempReadmemd.replace("\`", "`")
tempReadmemd = tempReadmemd.replace("😼", " :smiley_cat: ")
tempReadmemd = tempReadmemd.replace("🔥", " :fire: ")
with open(os.path.join(eveApplication, 'readme.md'), 'w') as f:
f.write(tempReadmemd)
with open(os.path.join(eveApplication, 'src/readme.md'), 'w') as f:
f.write(tempReadmemd)
versions = applicationVersion.split('.')
versions[-1] = str(int(versions[-1]) + 1)
yamlContent = yamlContent.replace(applicationVersion, '.'.join(versions))
with open(os.path.join(eveApplication, 'publish.yaml'), 'w') as f:
f.write(yamlContent)
if len(applicationPaths) > 1:
with open('./update.list', 'w') as f:
f.write('\n'.join(applicationPaths))