summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-06-17 14:47:47 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-23 11:47:36 +0100
commita4da21d92f461e85e90a866f4a1da34ba1c9551a (patch)
tree79bbf1c403f08487f4a4c29327fff0e0758dbf7b /scripts
parent4862a4c33a461d0f4dd75843d2f0a8b03a593b05 (diff)
downloadpoky-a4da21d92f461e85e90a866f4a1da34ba1c9551a.tar.gz
wic: code cleanup: superfluous-parens
Removed unncecessary parents after 'if' 'del' and 'print' keywords. Fixed pyling warning: Unnecessary parens after 'xxx' keyword (From OE-Core rev: a64604d11f75973b4c2347fa2669da9889e44013) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/image/engine.py6
-rw-r--r--scripts/lib/image/help.py2
-rw-r--r--scripts/lib/wic/3rdparty/pykickstart/options.py10
-rw-r--r--scripts/lib/wic/kickstart/custom_commands/partition.py14
-rw-r--r--scripts/lib/wic/plugin.py2
-rw-r--r--scripts/lib/wic/plugins/source/fsimage.py2
-rw-r--r--scripts/lib/wic/plugins/source/rawcopy.py4
-rw-r--r--scripts/lib/wic/utils/oe/misc.py6
8 files changed, 23 insertions, 23 deletions
diff --git a/scripts/lib/image/engine.py b/scripts/lib/image/engine.py
index 05c26386e7..c568d695df 100644
--- a/scripts/lib/image/engine.py
+++ b/scripts/lib/image/engine.py
@@ -70,13 +70,13 @@ def find_artifacts(image_name):
70 rootfs_dir = kernel_dir = bootimg_dir = native_sysroot = "" 70 rootfs_dir = kernel_dir = bootimg_dir = native_sysroot = ""
71 71
72 for line in bitbake_env_lines.split('\n'): 72 for line in bitbake_env_lines.split('\n'):
73 if (misc.get_line_val(line, "IMAGE_ROOTFS")): 73 if misc.get_line_val(line, "IMAGE_ROOTFS"):
74 rootfs_dir = misc.get_line_val(line, "IMAGE_ROOTFS") 74 rootfs_dir = misc.get_line_val(line, "IMAGE_ROOTFS")
75 continue 75 continue
76 if (misc.get_line_val(line, "DEPLOY_DIR_IMAGE")): 76 if misc.get_line_val(line, "DEPLOY_DIR_IMAGE"):
77 kernel_dir = misc.get_line_val(line, "DEPLOY_DIR_IMAGE") 77 kernel_dir = misc.get_line_val(line, "DEPLOY_DIR_IMAGE")
78 continue 78 continue
79 if (misc.get_line_val(line, "STAGING_DIR_NATIVE")): 79 if misc.get_line_val(line, "STAGING_DIR_NATIVE"):
80 native_sysroot = misc.get_line_val(line, "STAGING_DIR_NATIVE") 80 native_sysroot = misc.get_line_val(line, "STAGING_DIR_NATIVE")
81 continue 81 continue
82 82
diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py
index 93211498d5..886437ba60 100644
--- a/scripts/lib/image/help.py
+++ b/scripts/lib/image/help.py
@@ -53,7 +53,7 @@ def wic_help(args, usage_str, subcommands):
53 Subcommand help dispatcher. 53 Subcommand help dispatcher.
54 """ 54 """
55 if len(args) == 1 or not display_help(args[1], subcommands): 55 if len(args) == 1 or not display_help(args[1], subcommands):
56 print(usage_str) 56 print usage_str
57 57
58 58
59def get_wic_plugins_help(): 59def get_wic_plugins_help():
diff --git a/scripts/lib/wic/3rdparty/pykickstart/options.py b/scripts/lib/wic/3rdparty/pykickstart/options.py
index b2d8e3e516..ebc23eda63 100644
--- a/scripts/lib/wic/3rdparty/pykickstart/options.py
+++ b/scripts/lib/wic/3rdparty/pykickstart/options.py
@@ -145,19 +145,19 @@ def _check_string(option, opt, value):
145 145
146def _check_size(option, opt, value): 146def _check_size(option, opt, value):
147 # Former default was MB 147 # Former default was MB
148 if (value.isdigit()): 148 if value.isdigit():
149 return int(value) * 1024L 149 return int(value) * 1024L
150 150
151 mapping = {"opt": opt, "value": value} 151 mapping = {"opt": opt, "value": value}
152 if (not value[:-1].isdigit()): 152 if not value[:-1].isdigit():
153 raise OptionValueError(_("Option %(opt)s: invalid size value: %(value)r") % mapping) 153 raise OptionValueError(_("Option %(opt)s: invalid size value: %(value)r") % mapping)
154 154
155 size = int(value[:-1]) 155 size = int(value[:-1])
156 if (value.endswith("k") or value.endswith("K")): 156 if value.endswith("k") or value.endswith("K"):
157 return size 157 return size
158 if (value.endswith("M")): 158 if value.endswith("M"):
159 return size * 1024L 159 return size * 1024L
160 if (value.endswith("G")): 160 if value.endswith("G"):
161 return size * 1024L * 1024L 161 return size * 1024L * 1024L
162 raise OptionValueError(_("Option %(opt)s: invalid size value: %(value)r") % mapping) 162 raise OptionValueError(_("Option %(opt)s: invalid size value: %(value)r") % mapping)
163 163
diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py
index 40c2772914..324ea690ec 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -268,7 +268,7 @@ class Wic_PartData(Mic_PartData):
268 extra_imagecmd = "-i 8192" 268 extra_imagecmd = "-i 8192"
269 269
270 label_str = "" 270 label_str = ""
271 if (self.label): 271 if self.label:
272 label_str = "-L %s" % self.label 272 label_str = "-L %s" % self.label
273 273
274 mkfs_cmd = "mkfs.%s -F %s %s %s -d %s" % \ 274 mkfs_cmd = "mkfs.%s -F %s %s %s -d %s" % \
@@ -315,7 +315,7 @@ class Wic_PartData(Mic_PartData):
315 exec_cmd(dd_cmd) 315 exec_cmd(dd_cmd)
316 316
317 label_str = "" 317 label_str = ""
318 if (self.label): 318 if self.label:
319 label_str = "-L %s" % self.label 319 label_str = "-L %s" % self.label
320 320
321 mkfs_cmd = "mkfs.%s -b %d -r %s %s %s" % \ 321 mkfs_cmd = "mkfs.%s -b %d -r %s %s %s" % \
@@ -361,7 +361,7 @@ class Wic_PartData(Mic_PartData):
361 blocks += (16 - (blocks % 16)) 361 blocks += (16 - (blocks % 16))
362 362
363 label_str = "-n boot" 363 label_str = "-n boot"
364 if (self.label): 364 if self.label:
365 label_str = "-n %s" % self.label 365 label_str = "-n %s" % self.label
366 366
367 dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks) 367 dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks)
@@ -436,7 +436,7 @@ class Wic_PartData(Mic_PartData):
436 extra_imagecmd = "-i 8192" 436 extra_imagecmd = "-i 8192"
437 437
438 label_str = "" 438 label_str = ""
439 if (self.label): 439 if self.label:
440 label_str = "-L %s" % self.label 440 label_str = "-L %s" % self.label
441 441
442 mkfs_cmd = "mkfs.%s -F %s %s %s" % \ 442 mkfs_cmd = "mkfs.%s -F %s %s %s" % \
@@ -460,7 +460,7 @@ class Wic_PartData(Mic_PartData):
460 exec_cmd(dd_cmd) 460 exec_cmd(dd_cmd)
461 461
462 label_str = "" 462 label_str = ""
463 if (self.label): 463 if self.label:
464 label_str = "-L %s" % self.label 464 label_str = "-L %s" % self.label
465 465
466 mkfs_cmd = "mkfs.%s -b %d %s %s" % \ 466 mkfs_cmd = "mkfs.%s -b %d %s %s" % \
@@ -482,7 +482,7 @@ class Wic_PartData(Mic_PartData):
482 blocks = self.size 482 blocks = self.size
483 483
484 label_str = "-n boot" 484 label_str = "-n boot"
485 if (self.label): 485 if self.label:
486 label_str = "-n %s" % self.label 486 label_str = "-n %s" % self.label
487 487
488 dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, fs, blocks) 488 dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, fs, blocks)
@@ -553,7 +553,7 @@ class Wic_Partition(Mic_Partition):
553 553
554 def _getParser(self): 554 def _getParser(self):
555 def overhead_cb (option, opt_str, value, parser): 555 def overhead_cb (option, opt_str, value, parser):
556 if (value < 1): 556 if value < 1:
557 raise OptionValueError("Option %s: invalid value: %r" % (option, value)) 557 raise OptionValueError("Option %s: invalid value: %r" % (option, value))
558 setattr(parser.values, option.dest, value) 558 setattr(parser.values, option.dest, value)
559 559
diff --git a/scripts/lib/wic/plugin.py b/scripts/lib/wic/plugin.py
index 9872d20985..fff02c063b 100644
--- a/scripts/lib/wic/plugin.py
+++ b/scripts/lib/wic/plugin.py
@@ -103,7 +103,7 @@ class PluginMgr(object):
103 % (os.path.basename(pdir), mod, err) 103 % (os.path.basename(pdir), mod, err)
104 msger.warning(msg) 104 msger.warning(msg)
105 105
106 del(sys.path[0]) 106 del sys.path[0]
107 107
108 def get_plugins(self, ptype): 108 def get_plugins(self, ptype):
109 """ the return value is dict of name:class pairs """ 109 """ the return value is dict of name:class pairs """
diff --git a/scripts/lib/wic/plugins/source/fsimage.py b/scripts/lib/wic/plugins/source/fsimage.py
index 98f02a1e09..f894e89367 100644
--- a/scripts/lib/wic/plugins/source/fsimage.py
+++ b/scripts/lib/wic/plugins/source/fsimage.py
@@ -62,7 +62,7 @@ class FSImagePlugin(SourcePlugin):
62 62
63 msger.debug('Bootimg dir: %s' % bootimg_dir) 63 msger.debug('Bootimg dir: %s' % bootimg_dir)
64 64
65 if ('file' not in source_params): 65 if 'file' not in source_params:
66 msger.error("No file specified\n") 66 msger.error("No file specified\n")
67 return 67 return
68 68
diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py
index 071b2d2032..f0691baa91 100644
--- a/scripts/lib/wic/plugins/source/rawcopy.py
+++ b/scripts/lib/wic/plugins/source/rawcopy.py
@@ -62,14 +62,14 @@ class RawCopyPlugin(SourcePlugin):
62 62
63 msger.debug('Bootimg dir: %s' % bootimg_dir) 63 msger.debug('Bootimg dir: %s' % bootimg_dir)
64 64
65 if ('file' not in source_params): 65 if 'file' not in source_params:
66 msger.error("No file specified\n") 66 msger.error("No file specified\n")
67 return 67 return
68 68
69 src = os.path.join(bootimg_dir, source_params['file']) 69 src = os.path.join(bootimg_dir, source_params['file'])
70 dst = src 70 dst = src
71 71
72 if ('skip' in source_params): 72 if 'skip' in source_params:
73 dst = os.path.join(cr_workdir, source_params['file']) 73 dst = os.path.join(cr_workdir, source_params['file'])
74 dd_cmd = "dd if=%s of=%s ibs=%s skip=1 conv=notrunc" % \ 74 dd_cmd = "dd if=%s of=%s ibs=%s skip=1 conv=notrunc" % \
75 (src, dst, source_params['skip']) 75 (src, dst, source_params['skip'])
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py
index f08ff15a34..2f916ddf45 100644
--- a/scripts/lib/wic/utils/oe/misc.py
+++ b/scripts/lib/wic/utils/oe/misc.py
@@ -38,7 +38,7 @@ def __exec_cmd(cmd_and_args, as_shell=False, catch=3):
38 args = cmd_and_args.split() 38 args = cmd_and_args.split()
39 msger.debug(args) 39 msger.debug(args)
40 40
41 if (as_shell): 41 if as_shell:
42 rc, out = runner.runtool(cmd_and_args, catch) 42 rc, out = runner.runtool(cmd_and_args, catch)
43 else: 43 else:
44 rc, out = runner.runtool(args, catch) 44 rc, out = runner.runtool(args, catch)
@@ -142,7 +142,7 @@ def find_artifact(bitbake_env_lines, variable):
142 retval = "" 142 retval = ""
143 143
144 for line in bitbake_env_lines.split('\n'): 144 for line in bitbake_env_lines.split('\n'):
145 if (get_line_val(line, variable)): 145 if get_line_val(line, variable):
146 retval = get_line_val(line, variable) 146 retval = get_line_val(line, variable)
147 break 147 break
148 148
@@ -160,7 +160,7 @@ def get_line_val(line, key):
160 160
161def get_bitbake_var(key): 161def get_bitbake_var(key):
162 for line in __bitbake_env_lines.split('\n'): 162 for line in __bitbake_env_lines.split('\n'):
163 if (get_line_val(line, key)): 163 if get_line_val(line, key):
164 val = get_line_val(line, key) 164 val = get_line_val(line, key)
165 return val 165 return val
166 return None 166 return None