diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-04-15 23:47:10 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-24 11:06:55 +0100 |
| commit | f2a0a985236af116a84cc62a4f7e1d4707aea6e9 (patch) | |
| tree | 781ff0e7990d38b314d9bea34a02abf085ff453d /scripts/wic | |
| parent | 1d0c3387e8881a7a372ee38c0944540ce2ac8bc5 (diff) | |
| download | poky-f2a0a985236af116a84cc62a4f7e1d4707aea6e9.tar.gz | |
wic: code cleanup: wildcard imports
Here is what PEP8(Style Guide for Python Code) says about this:
Wildcard imports (from <module> import *) should be avoided, as they
make it unclear which names are present in the namespace, confusing
both readers and many automated tools.
(From OE-Core rev: 13416c1941f5dc8abcdb0073f2104a89eae2d6f1)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/wic')
| -rwxr-xr-x | scripts/wic | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/scripts/wic b/scripts/wic index 7d388c9768..1e07dfe922 100755 --- a/scripts/wic +++ b/scripts/wic | |||
| @@ -52,8 +52,9 @@ if bitbake_exe: | |||
| 52 | else: | 52 | else: |
| 53 | bitbake_main = None | 53 | bitbake_main = None |
| 54 | 54 | ||
| 55 | from image.help import * | 55 | from wic.utils.oe.misc import find_bitbake_env_lines, set_bitbake_env_lines |
| 56 | from image.engine import * | 56 | from image import engine |
| 57 | from image import help as hlp | ||
| 57 | 58 | ||
| 58 | def rootfs_dir_to_args(krootfs_dir): | 59 | def rootfs_dir_to_args(krootfs_dir): |
| 59 | """ | 60 | """ |
| @@ -132,7 +133,7 @@ def wic_create_subcommand(args, usage_str): | |||
| 132 | 133 | ||
| 133 | if options.build_check and not options.properties_file: | 134 | if options.build_check and not options.properties_file: |
| 134 | print "Checking basic build environment..." | 135 | print "Checking basic build environment..." |
| 135 | if not verify_build_env(): | 136 | if not engine.verify_build_env(): |
| 136 | print "Couldn't verify build environment, exiting\n" | 137 | print "Couldn't verify build environment, exiting\n" |
| 137 | sys.exit(1) | 138 | sys.exit(1) |
| 138 | else: | 139 | else: |
| @@ -158,7 +159,7 @@ def wic_create_subcommand(args, usage_str): | |||
| 158 | sys.exit(1) | 159 | sys.exit(1) |
| 159 | 160 | ||
| 160 | (rootfs_dir, kernel_dir, bootimg_dir, native_sysroot) \ | 161 | (rootfs_dir, kernel_dir, bootimg_dir, native_sysroot) \ |
| 161 | = find_artifacts(options.image_name) | 162 | = engine.find_artifacts(options.image_name) |
| 162 | 163 | ||
| 163 | else: | 164 | else: |
| 164 | if options.build_rootfs: | 165 | if options.build_rootfs: |
| @@ -168,7 +169,7 @@ def wic_create_subcommand(args, usage_str): | |||
| 168 | wks_file = args[0] | 169 | wks_file = args[0] |
| 169 | 170 | ||
| 170 | if not wks_file.endswith(".wks"): | 171 | if not wks_file.endswith(".wks"): |
| 171 | wks_file = find_canned_image(scripts_path, wks_file) | 172 | wks_file = engine.find_canned_image(scripts_path, wks_file) |
| 172 | if not wks_file: | 173 | if not wks_file: |
| 173 | print "No image named %s found, exiting. (Use 'wic list images' to list available images, or specify a fully-qualified OE kickstart (.wks) filename)\n" % wks_file | 174 | print "No image named %s found, exiting. (Use 'wic list images' to list available images, or specify a fully-qualified OE kickstart (.wks) filename)\n" % wks_file |
| 174 | sys.exit(1) | 175 | sys.exit(1) |
| @@ -223,9 +224,9 @@ def wic_create_subcommand(args, usage_str): | |||
| 223 | rootfs_dir = rootfs_dir_to_args(krootfs_dir) | 224 | rootfs_dir = rootfs_dir_to_args(krootfs_dir) |
| 224 | 225 | ||
| 225 | print "Creating image(s)...\n" | 226 | print "Creating image(s)...\n" |
| 226 | wic_create(args, wks_file, rootfs_dir, bootimg_dir, kernel_dir, | 227 | engine.wic_create(args, wks_file, rootfs_dir, bootimg_dir, kernel_dir, |
| 227 | native_sysroot, scripts_path, image_output_dir, | 228 | native_sysroot, scripts_path, image_output_dir, |
| 228 | options.debug, options.properties_file) | 229 | options.debug, options.properties_file) |
| 229 | 230 | ||
| 230 | 231 | ||
| 231 | def wic_list_subcommand(args, usage_str): | 232 | def wic_list_subcommand(args, usage_str): |
| @@ -247,7 +248,7 @@ def wic_list_subcommand(args, usage_str): | |||
| 247 | sys.exit(1) | 248 | sys.exit(1) |
| 248 | set_bitbake_env_lines(bitbake_env_lines) | 249 | set_bitbake_env_lines(bitbake_env_lines) |
| 249 | 250 | ||
| 250 | if not wic_list(args, scripts_path, options.properties_file): | 251 | if not engine.wic_list(args, scripts_path, options.properties_file): |
| 251 | logging.error("Bad list arguments, exiting\n") | 252 | logging.error("Bad list arguments, exiting\n") |
| 252 | parser.print_help() | 253 | parser.print_help() |
| 253 | sys.exit(1) | 254 | sys.exit(1) |
| @@ -268,20 +269,20 @@ wic_help_topic_usage = """ | |||
| 268 | 269 | ||
| 269 | subcommands = { | 270 | subcommands = { |
| 270 | "create": [wic_create_subcommand, | 271 | "create": [wic_create_subcommand, |
| 271 | wic_create_usage, | 272 | hlp.wic_create_usage, |
| 272 | wic_create_help], | 273 | hlp.wic_create_help], |
| 273 | "list": [wic_list_subcommand, | 274 | "list": [wic_list_subcommand, |
| 274 | wic_list_usage, | 275 | hlp.wic_list_usage, |
| 275 | wic_list_help], | 276 | hlp.wic_list_help], |
| 276 | "plugins": [wic_help_topic_subcommand, | 277 | "plugins": [wic_help_topic_subcommand, |
| 277 | wic_help_topic_usage, | 278 | wic_help_topic_usage, |
| 278 | wic_plugins_help], | 279 | hlp.wic_plugins_help], |
| 279 | "overview": [wic_help_topic_subcommand, | 280 | "overview": [wic_help_topic_subcommand, |
| 280 | wic_help_topic_usage, | 281 | wic_help_topic_usage, |
| 281 | wic_overview_help], | 282 | hlp.wic_overview_help], |
| 282 | "kickstart": [wic_help_topic_subcommand, | 283 | "kickstart": [wic_help_topic_subcommand, |
| 283 | wic_help_topic_usage, | 284 | wic_help_topic_usage, |
| 284 | wic_kickstart_help], | 285 | hlp.wic_kickstart_help], |
| 285 | } | 286 | } |
| 286 | 287 | ||
| 287 | 288 | ||
| @@ -291,7 +292,7 @@ def start_logging(loglevel): | |||
| 291 | 292 | ||
| 292 | def main(argv): | 293 | def main(argv): |
| 293 | parser = optparse.OptionParser(version="wic version %s" % __version__, | 294 | parser = optparse.OptionParser(version="wic version %s" % __version__, |
| 294 | usage=wic_usage) | 295 | usage=hlp.wic_usage) |
| 295 | 296 | ||
| 296 | parser.disable_interspersed_args() | 297 | parser.disable_interspersed_args() |
| 297 | 298 | ||
| @@ -303,7 +304,7 @@ def main(argv): | |||
| 303 | parser.print_help() | 304 | parser.print_help() |
| 304 | sys.exit(1) | 305 | sys.exit(1) |
| 305 | 306 | ||
| 306 | invoke_subcommand(args, parser, wic_help_usage, subcommands) | 307 | hlp.invoke_subcommand(args, parser, hlp.wic_help_usage, subcommands) |
| 307 | 308 | ||
| 308 | 309 | ||
| 309 | if __name__ == "__main__": | 310 | if __name__ == "__main__": |
