Removed unncecessary parents after 'if' 'del' and 'print' keywords.
Fixed pyling warning: Unnecessary parens after 'xxx' keyword
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
rootfs_dir = kernel_dir = bootimg_dir = native_sysroot = ""
for line in bitbake_env_lines.split('\n'):
- if (misc.get_line_val(line, "IMAGE_ROOTFS")):
+ if misc.get_line_val(line, "IMAGE_ROOTFS"):
rootfs_dir = misc.get_line_val(line, "IMAGE_ROOTFS")
continue
- if (misc.get_line_val(line, "DEPLOY_DIR_IMAGE")):
+ if misc.get_line_val(line, "DEPLOY_DIR_IMAGE"):
kernel_dir = misc.get_line_val(line, "DEPLOY_DIR_IMAGE")
continue
- if (misc.get_line_val(line, "STAGING_DIR_NATIVE")):
+ if misc.get_line_val(line, "STAGING_DIR_NATIVE"):
native_sysroot = misc.get_line_val(line, "STAGING_DIR_NATIVE")
continue
Subcommand help dispatcher.
"""
if len(args) == 1 or not display_help(args[1], subcommands):
- print(usage_str)
+ print usage_str
def get_wic_plugins_help():
def _check_size(option, opt, value):
# Former default was MB
- if (value.isdigit()):
+ if value.isdigit():
return int(value) * 1024L
mapping = {"opt": opt, "value": value}
- if (not value[:-1].isdigit()):
+ if not value[:-1].isdigit():
raise OptionValueError(_("Option %(opt)s: invalid size value: %(value)r") % mapping)
size = int(value[:-1])
- if (value.endswith("k") or value.endswith("K")):
+ if value.endswith("k") or value.endswith("K"):
return size
- if (value.endswith("M")):
+ if value.endswith("M"):
return size * 1024L
- if (value.endswith("G")):
+ if value.endswith("G"):
return size * 1024L * 1024L
raise OptionValueError(_("Option %(opt)s: invalid size value: %(value)r") % mapping)
extra_imagecmd = "-i 8192"
label_str = ""
- if (self.label):
+ if self.label:
label_str = "-L %s" % self.label
mkfs_cmd = "mkfs.%s -F %s %s %s -d %s" % \
exec_cmd(dd_cmd)
label_str = ""
- if (self.label):
+ if self.label:
label_str = "-L %s" % self.label
mkfs_cmd = "mkfs.%s -b %d -r %s %s %s" % \
blocks += (16 - (blocks % 16))
label_str = "-n boot"
- if (self.label):
+ if self.label:
label_str = "-n %s" % self.label
dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks)
extra_imagecmd = "-i 8192"
label_str = ""
- if (self.label):
+ if self.label:
label_str = "-L %s" % self.label
mkfs_cmd = "mkfs.%s -F %s %s %s" % \
exec_cmd(dd_cmd)
label_str = ""
- if (self.label):
+ if self.label:
label_str = "-L %s" % self.label
mkfs_cmd = "mkfs.%s -b %d %s %s" % \
blocks = self.size
label_str = "-n boot"
- if (self.label):
+ if self.label:
label_str = "-n %s" % self.label
dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, fs, blocks)
def _getParser(self):
def overhead_cb (option, opt_str, value, parser):
- if (value < 1):
+ if value < 1:
raise OptionValueError("Option %s: invalid value: %r" % (option, value))
setattr(parser.values, option.dest, value)
% (os.path.basename(pdir), mod, err)
msger.warning(msg)
- del(sys.path[0])
+ del sys.path[0]
def get_plugins(self, ptype):
""" the return value is dict of name:class pairs """
msger.debug('Bootimg dir: %s' % bootimg_dir)
- if ('file' not in source_params):
+ if 'file' not in source_params:
msger.error("No file specified\n")
return
msger.debug('Bootimg dir: %s' % bootimg_dir)
- if ('file' not in source_params):
+ if 'file' not in source_params:
msger.error("No file specified\n")
return
src = os.path.join(bootimg_dir, source_params['file'])
dst = src
- if ('skip' in source_params):
+ if 'skip' in source_params:
dst = os.path.join(cr_workdir, source_params['file'])
dd_cmd = "dd if=%s of=%s ibs=%s skip=1 conv=notrunc" % \
(src, dst, source_params['skip'])
args = cmd_and_args.split()
msger.debug(args)
- if (as_shell):
+ if as_shell:
rc, out = runner.runtool(cmd_and_args, catch)
else:
rc, out = runner.runtool(args, catch)
retval = ""
for line in bitbake_env_lines.split('\n'):
- if (get_line_val(line, variable)):
+ if get_line_val(line, variable):
retval = get_line_val(line, variable)
break
def get_bitbake_var(key):
for line in __bitbake_env_lines.split('\n'):
- if (get_line_val(line, key)):
+ if get_line_val(line, key):
val = get_line_val(line, key)
return val
return None