-
Notifications
You must be signed in to change notification settings - Fork 9
/
update-indexes.py
executable file
·52 lines (48 loc) · 1.1 KB
/
update-indexes.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
#! python3.4
import os
print('Updating icons-taranis')
f = open('_data/icons-taranis.yml', 'w')
dlist = os.listdir("assets/images/icons-taranis")
dlist.sort()
for dname in dlist:
s = '- name: "{}"'.format(dname)
print(s)
f.write(s)
f.write('\n')
s = ' type: title'
print(s)
f.write(s)
f.write('\n')
flist = os.listdir('assets/images/icons-taranis/{}'.format(dname))
flist.sort()
for fname in flist:
s = '- name: "{}"'.format(fname)
print(s)
f.write(s)
f.write('\n')
s = ' type: image'
print(s)
f.write(s)
f.write('\n')
s = ' url: assets/images/icons-taranis/{}/{}'.format(dname, fname)
print(s)
f.write(s)
f.write('\n')
print('Updating screens-taranis')
f = open('_data/screens-taranis.yml', 'w')
l = os.listdir("assets/images/screens-taranis")
l.sort()
for file in l:
s = '- name: "{}"'.format(file)
print(s)
f.write(s)
f.write('\n')
print('Updating screens-9x')
f = open('_data/screens-9x.yml', 'w')
l = os.listdir("assets/images/screens-9x")
l.sort()
for file in l:
s = '- name: "{}"'.format(file)
print(s)
f.write(s)
f.write('\n')