Commit 1c00fa35e26cbebc9b6b5dd5adde2a1fbc9b71a5

Authored by André Araújo
1 parent eaa49245
Exists in master

Corrige python path no Controller.py

Showing 1 changed file with 12 additions and 13 deletions   Show diff stats
controller.py
1 1 # -*- coding: UTF-8 -*-
2 2  
3   -from os import getcwd
4 3 from subprocess import call
5   -from sys import argv, path
  4 +from sys import argv
  5 +from os.path import abspath, dirname, join
6 6  
7   -path.append(getcwd())
  7 +getcwd = dirname(abspath(__file__))
8 8  
9 9 from pyutil import printStackTrace
10   -currentPath = path[0] + "/"
11   -blend = currentPath + "avatar_Hozana_wikiLibras.blend"
12   -main = currentPath+"libras.py"
13 10  
14   -if (len(argv) > 1):
15   - try:
16   - call(["blender", "-b", blend, "-P", main, argv[1]])
17   - exit(0)
18   - except:
19   - printStackTrace(__file__)
  11 +blend_path = join(getcwd, "avatar_Hozana_wikiLibras.blend")
  12 +main_path = join(getcwd, "libras.py")
  13 +restult = 0
20 14  
21   -exit(1)
  15 +try:
  16 + restult = call(["blender", "-b", blend_path, "-P", main_path, argv[1]])
  17 +except:
  18 + restult = printStackTrace(__file__)
  19 +
  20 +exit(restult)
... ...