exiting wasnt working (was raising errors), also use dict.keys() rather then appending from iteritems,

This commit is contained in:
Campbell Barton
2008-07-09 00:58:57 +00:00
parent e279fc4a81
commit 16dccd3ffd

View File

@@ -69,10 +69,10 @@ def internal_lib_to_dict(dict = None, libtype = None, libname = None, priority =
dict[libtype][priority] = libname dict[libtype][priority] = libname
# libtype and priority can both be lists, for defining lib in multiple places # libtype and priority can both be lists, for defining lib in multiple places
def add_lib_to_dict(dict = None, libtype = None, libname = None, priority = 100): def add_lib_to_dict(env, dict = None, libtype = None, libname = None, priority = 100):
if not dict or not libtype or not libname: if not dict or not libtype or not libname:
print "Passed wrong arg" print "Passed wrong arg"
Exit() env.Exit()
if type(libtype) is str and type(priority) is int: if type(libtype) is str and type(priority) is int:
internal_lib_to_dict(dict, libtype, libname, priority) internal_lib_to_dict(dict, libtype, libname, priority)
@@ -82,10 +82,10 @@ def add_lib_to_dict(dict = None, libtype = None, libname = None, priority = 100)
internal_lib_to_dict(dict, lt, libname, p) internal_lib_to_dict(dict, lt, libname, p)
else: else:
print "libtype and priority lists are unequal in length" print "libtype and priority lists are unequal in length"
Exit() env.Exit()
else: else:
print "Wrong type combinations for libtype and priority. Only str and int or list and list" print "Wrong type combinations for libtype and priority. Only str and int or list and list"
Exit() env.Exit()
def create_blender_liblist(lenv = None, libtype = None): def create_blender_liblist(lenv = None, libtype = None):
if not lenv or not libtype: if not lenv or not libtype:
@@ -93,11 +93,9 @@ def create_blender_liblist(lenv = None, libtype = None):
lst = [] lst = []
if libtype in possible_types: if libtype in possible_types:
sortlist = []
for k,v in libs[libtype].iteritems():
sortlist.append(k)
sortlist.sort()
curlib = libs[libtype] curlib = libs[libtype]
sortlist = curlib.keys()
sortlist.sort()
for sk in sortlist: for sk in sortlist:
v = curlib[sk] v = curlib[sk]
lst.append('#' + root_build_dir + 'lib/'+lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX']) lst.append('#' + root_build_dir + 'lib/'+lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX'])
@@ -175,11 +173,10 @@ def propose_priorities():
for t in possible_types: for t in possible_types:
print bc.OKGREEN+"\t"+t+bc.ENDC print bc.OKGREEN+"\t"+t+bc.ENDC
new_priority = 0 new_priority = 0
sortlist = []
for k,v in libs[t].iteritems():
sortlist.append(k)
sortlist.sort()
curlib = libs[t] curlib = libs[t]
sortlist = curlib.keys()
sortlist.sort()
for sk in sortlist: for sk in sortlist:
v = curlib[sk] v = curlib[sk]
#for p,v in sorted(libs[t].iteritems()): #for p,v in sorted(libs[t].iteritems()):
@@ -368,7 +365,7 @@ class BlenderEnvironment(SConsEnvironment):
global libs global libs
if not self or not libname or not source: if not self or not libname or not source:
print bc.FAIL+'Cannot continue. Missing argument for BlenderRes '+libname+bc.ENDC print bc.FAIL+'Cannot continue. Missing argument for BlenderRes '+libname+bc.ENDC
Exit() self.Exit()
if self['OURPLATFORM'] not in ('win32-vc','win32-mingw','linuxcross'): if self['OURPLATFORM'] not in ('win32-vc','win32-mingw','linuxcross'):
print bc.FAIL+'BlenderRes is for windows only!'+bc.END print bc.FAIL+'BlenderRes is for windows only!'+bc.END
self.Exit() self.Exit()
@@ -383,7 +380,7 @@ class BlenderEnvironment(SConsEnvironment):
def BlenderLib(self=None, libname=None, sources=None, includes=[], defines=[], libtype='common', priority = 100, compileflags=None): def BlenderLib(self=None, libname=None, sources=None, includes=[], defines=[], libtype='common', priority = 100, compileflags=None):
if not self or not libname or not sources: if not self or not libname or not sources:
print bc.FAIL+'Cannot continue. Missing argument for BuildBlenderLib '+libname+bc.ENDC print bc.FAIL+'Cannot continue. Missing argument for BuildBlenderLib '+libname+bc.ENDC
Exit() self.Exit()
if libname in quickie or len(quickie)==0: if libname in quickie or len(quickie)==0:
if libname in quickdebug: if libname in quickdebug:
print bc.HEADER+'Configuring library '+bc.ENDC+bc.OKGREEN+libname +bc.ENDC+bc.OKBLUE+ " (debug mode)" + bc.ENDC print bc.HEADER+'Configuring library '+bc.ENDC+bc.OKGREEN+libname +bc.ENDC+bc.OKBLUE+ " (debug mode)" + bc.ENDC
@@ -419,7 +416,7 @@ class BlenderEnvironment(SConsEnvironment):
else: else:
print bc.WARNING+'Not building '+bc.ENDC+bc.OKGREEN+libname+bc.ENDC+' for '+bc.OKBLUE+'BF_QUICK'+bc.ENDC print bc.WARNING+'Not building '+bc.ENDC+bc.OKGREEN+libname+bc.ENDC+' for '+bc.OKBLUE+'BF_QUICK'+bc.ENDC
# note: libs is a global # note: libs is a global
add_lib_to_dict(libs, libtype, libname, priority) add_lib_to_dict(self, libs, libtype, libname, priority)
def BlenderProg(self=None, builddir=None, progname=None, sources=None, includes=None, libs=None, libpath=None, binarykind=''): def BlenderProg(self=None, builddir=None, progname=None, sources=None, includes=None, libs=None, libpath=None, binarykind=''):
print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC