-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathprocess_batch_icons.py
More file actions
34 lines (25 loc) · 917 Bytes
/
process_batch_icons.py
File metadata and controls
34 lines (25 loc) · 917 Bytes
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
# takes the screenshot for an icon
import os
import subprocess
from cry_utils.get_files_by_type import get_all_files
def space_seperator(arr):
x = ''
for item in arr:
x += ' ' + item + ' '
return x
def remove_top_line(f):
with open(f, 'r') as fin:
data = fin.read().splitlines(True)
with open(f, 'w') as fout:
fout.writelines(data[1:])
def capture():
scripts_dir = os.path.abspath(os.path.dirname(__file__))
screenshot_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'user', 'screenshots'))
images = get_all_files('.jpg', screenshot_dir)
with open(scripts_dir + '//iconfile_done.txt') as infile:
data = infile.read().splitlines(True)
for x in data:
subprocess.Popen('python %s %s --args %s' % (
scripts_dir + '\\icon_object_create_icon.py', x.split(',')[1], space_seperator(images)))
if __name__ == '__main__':
capture()