|
|
|
|
|
|
"or use a different worker number.".format(str(worker_id))) |
|
|
|
|
|
|
|
cwd = os.getcwd() |
|
|
|
file_name = file_name.strip() |
|
|
|
true_filename = (os.path.basename(os.path.normpath(file_name)) |
|
|
|
file_name = (file_name.strip() |
|
|
|
true_filename = os.path.basename(os.path.normpath(file_name)) |
|
|
|
launch_string = None |
|
|
|
if platform == "linux" or platform == "linux2": |
|
|
|
candidates = glob.glob(os.path.join(cwd, file_name) + '.x86_64') |
|
|
|
|
|
|
candidates = glob.glob(file_name + '.x86_64') |
|
|
|
if len(candidates) == 0: |
|
|
|
candidates = glob.glob(file_name + '.x86') |
|
|
|
if len(candidates) == 0: |
|
|
|
candidates = glob.glob(file_name) |
|
|
|
if len(candidates) > 0: |
|
|
|
launch_string = candidates[0] |
|
|
|
|
|
|
|
|
|
|
candidates = glob.glob(os.path.join(file_name + '.app', 'Contents', 'MacOS', true_filename)) |
|
|
|
if len(candidates) == 0: |
|
|
|
candidates = glob.glob(os.path.join(file_name, 'Contents', 'MacOS', true_filename)) |
|
|
|
if len(candidates) > 0: |
|
|
|
launch_string = candidates[0] |
|
|
|
elif platform == 'win32': |
|
|
|
|
|
|
if len(candidates) == 0: |
|
|
|
candidates = glob.glob(file_name) |
|
|
|
self.close() |
|
|
|
raise UnityEnvironmentException("Couldn't launch the {0} environment. " |
|
|
|
"Provided filename does not match any environments." |
|
|
|
.format(true_filename)) |
|
|
|