Changeset 90:5acea1f153ba for generate.py
- Timestamp:
- Jan 5, 2009, 5:35:20 PM (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generate.py
r72 r90 23 23 ## 24 24 25 import sys, os, subprocess25 import sys, os, re, subprocess 26 26 27 27 CMD_PYTHON = 'python' 28 QOOXDOO_PATH = '../qooxdoo-0.8-sdk' 29 REAL_GENERATOR = os.path.normpath( 30 os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), 31 QOOXDOO_PATH, 'tool', 'bin', 'generator.py')) 32 33 os.chdir(os.path.dirname(sys.argv[0])) # switch to skeleton dir 28 QOOXDOO_PATH = '../qooxdoo-0.8.1-sdk' 29 30 def getQxPath(): 31 path = QOOXDOO_PATH 32 # try updating from config file 33 if os.path.exists('config.json'): 34 # "using QOOXDOO_PATH from config.json" 35 qpathr=re.compile(r'"QOOXDOO_PATH"\s*:\s*"([^"]*)"\s*,') 36 conffile = open('config.json') 37 aconffile = conffile.readlines() 38 for line in aconffile: 39 mo = qpathr.search(line) 40 if mo: 41 path = mo.group(1) 42 break # assume first occurance is ok 43 path = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), path)) 44 45 return path 46 47 os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # switch to skeleton dir 48 qxpath = getQxPath() 49 REAL_GENERATOR = os.path.join(qxpath, 'tool', 'bin', 'generator.py') 50 51 if not os.path.exists(REAL_GENERATOR): 52 print "Cannot find real generator script under: \"%s\"; aborting" % REAL_GENERATOR 53 sys.exit(1) 34 54 35 55 argList = [] … … 47 67 else: 48 68 argList = ['"%s"' % x for x in argList] # quote argv elements 69 49 70 cmd = " ".join(argList) 50 71 subprocess.call(cmd, shell=True)
Note: See TracChangeset
for help on using the changeset viewer.