-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen.py
29 lines (25 loc) · 884 Bytes
/
gen.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
import os, sys, subprocess, shlex
def find_gpf_path():
"""find GenerateProjectFiles.bat path
return: str"""
s = '../../UnrealEngine/Engine/Build/BatchFiles/GenerateProjectFiles.bat'
for i in range(3):
if os.path.isfile(s):
return os.path.abspath(s)
else:
s = '../'+s
return ''
def list_dir(dir):
for d in os.listdir(dir):
if d.find('.uproject')>0 and os.path.isfile(d):
#os.environ.data['uproject'] = d
#print d
if find_gpf_path() == '':
print 'unrealengine path is invalide.'
cmd = find_gpf_path() + ' '+os.path.abspath(d)+' -Game -Engine'
#args = shlex.split(cmd)
args = cmd.split(' ')
#print args
p = subprocess.Popen(args, shell=True)
p.communicate()
list_dir(".")