mirror of
https://gitee.com/Vancouver2017/luban-lite.git
synced 2025-12-29 01:06:56 +00:00
v1.2.1
This commit is contained in:
@@ -309,7 +309,7 @@ def TargetEclipse(env, sdk=False, update=False):
|
||||
# remove old Option
|
||||
for l_opt in l_path.findall('listOptionValue'):
|
||||
l_path.remove(l_opt)
|
||||
if env.has_key('LIBS'):
|
||||
if 'LIBS' in env:
|
||||
libs = env['LIBS']
|
||||
else:
|
||||
libs = []
|
||||
@@ -326,7 +326,7 @@ def TargetEclipse(env, sdk=False, update=False):
|
||||
# remove old Option
|
||||
for l_opt in l_path.findall('listOptionValue'):
|
||||
l_path.remove(l_opt)
|
||||
if env.has_key('LIBPATH'):
|
||||
if 'LIBPATH' in env:
|
||||
libpath = env['LIBPATH']
|
||||
for src_d in libpath:
|
||||
rel_d = os.path.relpath(src_d, aic_root)
|
||||
@@ -447,7 +447,7 @@ def TargetEclipse(env, sdk=False, update=False):
|
||||
print('Copy image file...')
|
||||
dirs = []
|
||||
for i in range(2):
|
||||
if os.environ.has_key("img{}_srcdir".format(i)):
|
||||
if "img{}_srcdir".format(i) in os.environ:
|
||||
dirs.append(os.environ["img{}_srcdir".format(i)])
|
||||
for src_d in dirs:
|
||||
des_d = os.path.relpath(src_d, aic_root)
|
||||
@@ -460,11 +460,11 @@ def TargetEclipse(env, sdk=False, update=False):
|
||||
elif platform.system() == 'Windows':
|
||||
shutil.copytree('\\\\?\\' + src_d, '\\\\?\\' + des_d)
|
||||
# post-build
|
||||
if os.environ.has_key("eclipse_sdk_post_build"):
|
||||
if "eclipse_sdk_post_build" in os.environ:
|
||||
post_cmd = os.environ["eclipse_sdk_post_build"]
|
||||
else:
|
||||
# post-build
|
||||
if os.environ.has_key("eclipse_post_build"):
|
||||
if "eclipse_post_build" in os.environ:
|
||||
post_cmd = os.environ["eclipse_post_build"]
|
||||
l_configuration.attrib['postbuildStep'] = post_cmd
|
||||
|
||||
@@ -474,18 +474,18 @@ def TargetEclipse(env, sdk=False, update=False):
|
||||
pre_cmd = ''
|
||||
if sdk:
|
||||
# pre-build
|
||||
if os.environ.has_key("eclipse_sdk_pre_build"):
|
||||
if "eclipse_sdk_pre_build" in os.environ:
|
||||
pre_cmd = os.environ["eclipse_sdk_pre_build"]
|
||||
else:
|
||||
# pre-build
|
||||
if os.environ.has_key("eclipse_pre_build"):
|
||||
if "eclipse_pre_build" in os.environ:
|
||||
pre_cmd = os.environ["eclipse_pre_build"]
|
||||
l_configuration.attrib['prebuildStep'] = pre_cmd
|
||||
|
||||
# (2.2.11) user data directory
|
||||
prj_chip = os.environ["PRJ_CHIP"]
|
||||
prj_board = os.environ["PRJ_BOARD"]
|
||||
if sdk and os.environ.has_key("aic_fs_image_dir"):
|
||||
if sdk and "aic_fs_image_dir" in os.environ:
|
||||
print('Copy image data directory...')
|
||||
aic_fs_image_dir = os.environ["aic_fs_image_dir"]
|
||||
src_d = os.path.join(aic_root, aic_fs_image_dir)
|
||||
|
||||
@@ -3216,15 +3216,15 @@ class Kconfig(object):
|
||||
"set".format(node.item.name, env_var),
|
||||
self.filename, self.linenr)
|
||||
|
||||
# if env_var != node.item.name:
|
||||
# self._warn("Kconfiglib expands environment variables "
|
||||
# "in strings directly, meaning you do not "
|
||||
# "need 'option env=...' \"bounce\" symbols. "
|
||||
# "For compatibility with the C tools, "
|
||||
# "rename {} to {} (so that the symbol name "
|
||||
# "matches the environment variable name)."
|
||||
# .format(node.item.name, env_var),
|
||||
# self.filename, self.linenr)
|
||||
if env_var != node.item.name:
|
||||
self._warn("Kconfiglib expands environment variables "
|
||||
"in strings directly, meaning you do not "
|
||||
"need 'option env=...' \"bounce\" symbols. "
|
||||
"For compatibility with the C tools, "
|
||||
"rename {} to {} (so that the symbol name "
|
||||
"matches the environment variable name)."
|
||||
.format(node.item.name, env_var),
|
||||
self.filename, self.linenr)
|
||||
|
||||
elif self._check_token(_T_DEFCONFIG_LIST):
|
||||
if not self.defconfig_list:
|
||||
@@ -3837,8 +3837,8 @@ class Kconfig(object):
|
||||
for node in choice.nodes:
|
||||
if node.prompt:
|
||||
break
|
||||
else:
|
||||
self._warn(choice.name_and_loc + " defined without a prompt")
|
||||
else:
|
||||
self._warn(choice.name_and_loc + " defined without a prompt")
|
||||
|
||||
for default, _ in choice.defaults:
|
||||
if default.__class__ is not Symbol:
|
||||
@@ -3846,11 +3846,11 @@ class Kconfig(object):
|
||||
"{} has a malformed default {}"
|
||||
.format(choice.name_and_loc, expr_str(default)))
|
||||
|
||||
# if default.choice is not choice:
|
||||
# self._warn("the default selection {} of {} is not "
|
||||
# "contained in the choice"
|
||||
# .format(default.name_and_loc,
|
||||
# choice.name_and_loc))
|
||||
if default.choice is not choice:
|
||||
self._warn("the default selection {} of {} is not "
|
||||
"contained in the choice"
|
||||
.format(default.name_and_loc,
|
||||
choice.name_and_loc))
|
||||
|
||||
for sym in choice.syms:
|
||||
if sym.defaults:
|
||||
@@ -3870,10 +3870,10 @@ class Kconfig(object):
|
||||
self._warn("the choice symbol {} has no prompt"
|
||||
.format(sym.name_and_loc))
|
||||
|
||||
# elif node.prompt:
|
||||
# self._warn("the choice symbol {} is defined with a "
|
||||
# "prompt outside the choice"
|
||||
# .format(sym.name_and_loc))
|
||||
elif node.prompt:
|
||||
self._warn("the choice symbol {} is defined with a "
|
||||
"prompt outside the choice"
|
||||
.format(sym.name_and_loc))
|
||||
|
||||
def _parse_error(self, msg):
|
||||
raise KconfigError("{}error: couldn't parse '{}': {}".format(
|
||||
|
||||
Reference in New Issue
Block a user