diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-04-09 14:36:49 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-13 22:33:20 +0100 |
commit | d0d0ab85c49d7a874bef8b8d8844bbe9b1dc0c49 (patch) | |
tree | 7907a4a29e7d02b43af97f6f12c156519517438f | |
parent | 1521a3dda0a6ebcedb52f4a410f705c8d68d0a11 (diff) | |
download | poky-d0d0ab85c49d7a874bef8b8d8844bbe9b1dc0c49.tar.gz |
wic:code cleanup: No space allowed
Fixed pylint warning
'No space allowed around keyword argument assignment'
(From OE-Core rev: e07dd9b9c71960fbeded162ed52fbce06de620e9)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | scripts/lib/wic/imager/baseimager.py | 8 | ||||
-rw-r--r-- | scripts/lib/wic/imager/direct.py | 10 | ||||
-rw-r--r-- | scripts/lib/wic/kickstart/__init__.py | 14 | ||||
-rw-r--r-- | scripts/lib/wic/msger.py | 10 | ||||
-rw-r--r-- | scripts/lib/wic/utils/fs_related.py | 2 | ||||
-rw-r--r-- | scripts/lib/wic/utils/misc.py | 2 | ||||
-rw-r--r-- | scripts/lib/wic/utils/oe/misc.py | 8 | ||||
-rw-r--r-- | scripts/lib/wic/utils/partitionedfs.py | 8 | ||||
-rwxr-xr-x | scripts/wic | 58 |
9 files changed, 60 insertions, 60 deletions
diff --git a/scripts/lib/wic/imager/baseimager.py b/scripts/lib/wic/imager/baseimager.py index 2075358bdc..0afbc2cf0c 100644 --- a/scripts/lib/wic/imager/baseimager.py +++ b/scripts/lib/wic/imager/baseimager.py | |||
@@ -42,7 +42,7 @@ class BaseImageCreator(object): | |||
42 | def __del__(self): | 42 | def __del__(self): |
43 | self.cleanup() | 43 | self.cleanup() |
44 | 44 | ||
45 | def __init__(self, createopts = None): | 45 | def __init__(self, createopts=None): |
46 | """Initialize an ImageCreator instance. | 46 | """Initialize an ImageCreator instance. |
47 | 47 | ||
48 | ks -- a pykickstart.KickstartParser instance; this instance will be | 48 | ks -- a pykickstart.KickstartParser instance; this instance will be |
@@ -131,8 +131,8 @@ class BaseImageCreator(object): | |||
131 | self.workdir = os.path.join(self.tmpdir, "build") | 131 | self.workdir = os.path.join(self.tmpdir, "build") |
132 | if not os.path.exists(self.workdir): | 132 | if not os.path.exists(self.workdir): |
133 | os.makedirs(self.workdir) | 133 | os.makedirs(self.workdir) |
134 | self.__builddir = tempfile.mkdtemp(dir = self.workdir, | 134 | self.__builddir = tempfile.mkdtemp(dir=self.workdir, |
135 | prefix = "imgcreate-") | 135 | prefix="imgcreate-") |
136 | except OSError, (err, msg): | 136 | except OSError, (err, msg): |
137 | raise CreatorError("Failed create build directory in %s: %s" % | 137 | raise CreatorError("Failed create build directory in %s: %s" % |
138 | (self.tmpdir, msg)) | 138 | (self.tmpdir, msg)) |
@@ -178,7 +178,7 @@ class BaseImageCreator(object): | |||
178 | 178 | ||
179 | self._cleanup() | 179 | self._cleanup() |
180 | 180 | ||
181 | shutil.rmtree(self.__builddir, ignore_errors = True) | 181 | shutil.rmtree(self.__builddir, ignore_errors=True) |
182 | self.__builddir = None | 182 | self.__builddir = None |
183 | 183 | ||
184 | self.__clean_tmpdir() | 184 | self.__clean_tmpdir() |
diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py index b236c7a7d0..c1e5f09eee 100644 --- a/scripts/lib/wic/imager/direct.py +++ b/scripts/lib/wic/imager/direct.py | |||
@@ -269,11 +269,11 @@ class DirectImageCreator(BaseImageCreator): | |||
269 | p.source_file, | 269 | p.source_file, |
270 | p.fstype, | 270 | p.fstype, |
271 | p.label, | 271 | p.label, |
272 | fsopts = p.fsopts, | 272 | fsopts=p.fsopts, |
273 | boot = p.active, | 273 | boot=p.active, |
274 | align = p.align, | 274 | align=p.align, |
275 | no_table = p.no_table, | 275 | no_table=p.no_table, |
276 | part_type = p.part_type) | 276 | part_type=p.part_type) |
277 | 277 | ||
278 | self._restore_fstab(fstab) | 278 | self._restore_fstab(fstab) |
279 | 279 | ||
diff --git a/scripts/lib/wic/kickstart/__init__.py b/scripts/lib/wic/kickstart/__init__.py index 10959213d1..111723b133 100644 --- a/scripts/lib/wic/kickstart/__init__.py +++ b/scripts/lib/wic/kickstart/__init__.py | |||
@@ -68,7 +68,7 @@ def read_kickstart(path): | |||
68 | 68 | ||
69 | return ks | 69 | return ks |
70 | 70 | ||
71 | def get_image_size(ks, default = None): | 71 | def get_image_size(ks, default=None): |
72 | __size = 0 | 72 | __size = 0 |
73 | for p in ks.handler.partition.partitions: | 73 | for p in ks.handler.partition.partitions: |
74 | if p.mountpoint == "/" and p.size: | 74 | if p.mountpoint == "/" and p.size: |
@@ -78,40 +78,40 @@ def get_image_size(ks, default = None): | |||
78 | else: | 78 | else: |
79 | return default | 79 | return default |
80 | 80 | ||
81 | def get_image_fstype(ks, default = None): | 81 | def get_image_fstype(ks, default=None): |
82 | for p in ks.handler.partition.partitions: | 82 | for p in ks.handler.partition.partitions: |
83 | if p.mountpoint == "/" and p.fstype: | 83 | if p.mountpoint == "/" and p.fstype: |
84 | return p.fstype | 84 | return p.fstype |
85 | return default | 85 | return default |
86 | 86 | ||
87 | def get_image_fsopts(ks, default = None): | 87 | def get_image_fsopts(ks, default=None): |
88 | for p in ks.handler.partition.partitions: | 88 | for p in ks.handler.partition.partitions: |
89 | if p.mountpoint == "/" and p.fsopts: | 89 | if p.mountpoint == "/" and p.fsopts: |
90 | return p.fsopts | 90 | return p.fsopts |
91 | return default | 91 | return default |
92 | 92 | ||
93 | def get_timeout(ks, default = None): | 93 | def get_timeout(ks, default=None): |
94 | if not hasattr(ks.handler.bootloader, "timeout"): | 94 | if not hasattr(ks.handler.bootloader, "timeout"): |
95 | return default | 95 | return default |
96 | if ks.handler.bootloader.timeout is None: | 96 | if ks.handler.bootloader.timeout is None: |
97 | return default | 97 | return default |
98 | return int(ks.handler.bootloader.timeout) | 98 | return int(ks.handler.bootloader.timeout) |
99 | 99 | ||
100 | def get_kernel_args(ks, default = "ro rd.live.image"): | 100 | def get_kernel_args(ks, default="ro rd.live.image"): |
101 | if not hasattr(ks.handler.bootloader, "appendLine"): | 101 | if not hasattr(ks.handler.bootloader, "appendLine"): |
102 | return default | 102 | return default |
103 | if ks.handler.bootloader.appendLine is None: | 103 | if ks.handler.bootloader.appendLine is None: |
104 | return default | 104 | return default |
105 | return "%s %s" %(default, ks.handler.bootloader.appendLine) | 105 | return "%s %s" %(default, ks.handler.bootloader.appendLine) |
106 | 106 | ||
107 | def get_menu_args(ks, default = ""): | 107 | def get_menu_args(ks, default=""): |
108 | if not hasattr(ks.handler.bootloader, "menus"): | 108 | if not hasattr(ks.handler.bootloader, "menus"): |
109 | return default | 109 | return default |
110 | if ks.handler.bootloader.menus in (None, ""): | 110 | if ks.handler.bootloader.menus in (None, ""): |
111 | return default | 111 | return default |
112 | return "%s" % ks.handler.bootloader.menus | 112 | return "%s" % ks.handler.bootloader.menus |
113 | 113 | ||
114 | def get_default_kernel(ks, default = None): | 114 | def get_default_kernel(ks, default=None): |
115 | if not hasattr(ks.handler.bootloader, "default"): | 115 | if not hasattr(ks.handler.bootloader, "default"): |
116 | return default | 116 | return default |
117 | if not ks.handler.bootloader.default: | 117 | if not ks.handler.bootloader.default: |
diff --git a/scripts/lib/wic/msger.py b/scripts/lib/wic/msger.py index 9f557e7b9a..35b705b867 100644 --- a/scripts/lib/wic/msger.py +++ b/scripts/lib/wic/msger.py | |||
@@ -60,7 +60,7 @@ CATCHERR_BUFFILE_FD = -1 | |||
60 | CATCHERR_BUFFILE_PATH = None | 60 | CATCHERR_BUFFILE_PATH = None |
61 | CATCHERR_SAVED_2 = -1 | 61 | CATCHERR_SAVED_2 = -1 |
62 | 62 | ||
63 | def _general_print(head, color, msg = None, stream = None, level = 'normal'): | 63 | def _general_print(head, color, msg=None, stream=None, level='normal'): |
64 | global LOG_CONTENT | 64 | global LOG_CONTENT |
65 | if not stream: | 65 | if not stream: |
66 | stream = sys.stdout | 66 | stream = sys.stdout |
@@ -130,7 +130,7 @@ def _color_print(head, color, msg, stream, level): | |||
130 | 130 | ||
131 | stream.flush() | 131 | stream.flush() |
132 | 132 | ||
133 | def _color_perror(head, color, msg, level = 'normal'): | 133 | def _color_perror(head, color, msg, level='normal'): |
134 | if CATCHERR_BUFFILE_FD > 0: | 134 | if CATCHERR_BUFFILE_FD > 0: |
135 | _general_print(head, color, msg, sys.stdout, level) | 135 | _general_print(head, color, msg, sys.stdout, level) |
136 | else: | 136 | else: |
@@ -190,7 +190,7 @@ def info(msg): | |||
190 | 190 | ||
191 | def verbose(msg): | 191 | def verbose(msg): |
192 | head, msg = _split_msg('Verbose', msg) | 192 | head, msg = _split_msg('Verbose', msg) |
193 | _general_print(head, INFO_COLOR, msg, level = 'verbose') | 193 | _general_print(head, INFO_COLOR, msg, level='verbose') |
194 | 194 | ||
195 | def warning(msg): | 195 | def warning(msg): |
196 | head, msg = _split_msg('Warning', msg) | 196 | head, msg = _split_msg('Warning', msg) |
@@ -198,7 +198,7 @@ def warning(msg): | |||
198 | 198 | ||
199 | def debug(msg): | 199 | def debug(msg): |
200 | head, msg = _split_msg('Debug', msg) | 200 | head, msg = _split_msg('Debug', msg) |
201 | _color_perror(head, ERR_COLOR, msg, level = 'debug') | 201 | _color_perror(head, ERR_COLOR, msg, level='debug') |
202 | 202 | ||
203 | def error(msg): | 203 | def error(msg): |
204 | head, msg = _split_msg('Error', msg) | 204 | head, msg = _split_msg('Error', msg) |
@@ -299,7 +299,7 @@ def disable_logstderr(): | |||
299 | global CATCHERR_BUFFILE_PATH | 299 | global CATCHERR_BUFFILE_PATH |
300 | global CATCHERR_SAVED_2 | 300 | global CATCHERR_SAVED_2 |
301 | 301 | ||
302 | raw(msg = None) # flush message buffer and print it. | 302 | raw(msg=None) # flush message buffer and print it. |
303 | os.dup2(CATCHERR_SAVED_2, 2) | 303 | os.dup2(CATCHERR_SAVED_2, 2) |
304 | os.close(CATCHERR_SAVED_2) | 304 | os.close(CATCHERR_SAVED_2) |
305 | os.close(CATCHERR_BUFFILE_FD) | 305 | os.close(CATCHERR_BUFFILE_FD) |
diff --git a/scripts/lib/wic/utils/fs_related.py b/scripts/lib/wic/utils/fs_related.py index 1e266b16c1..d0bc8ee6d3 100644 --- a/scripts/lib/wic/utils/fs_related.py +++ b/scripts/lib/wic/utils/fs_related.py | |||
@@ -57,7 +57,7 @@ class Disk: | |||
57 | """ | 57 | """ |
58 | Generic base object for a disk. | 58 | Generic base object for a disk. |
59 | """ | 59 | """ |
60 | def __init__(self, size, device = None): | 60 | def __init__(self, size, device=None): |
61 | self._device = device | 61 | self._device = device |
62 | self._size = size | 62 | self._size = size |
63 | 63 | ||
diff --git a/scripts/lib/wic/utils/misc.py b/scripts/lib/wic/utils/misc.py index 5d6337c9cf..9d750694df 100644 --- a/scripts/lib/wic/utils/misc.py +++ b/scripts/lib/wic/utils/misc.py | |||
@@ -18,7 +18,7 @@ | |||
18 | import os | 18 | import os |
19 | import time | 19 | import time |
20 | 20 | ||
21 | def build_name(kscfg, release=None, prefix = None, suffix = None): | 21 | def build_name(kscfg, release=None, prefix=None, suffix=None): |
22 | """Construct and return an image name string. | 22 | """Construct and return an image name string. |
23 | 23 | ||
24 | This is a utility function to help create sensible name and fslabel | 24 | This is a utility function to help create sensible name and fslabel |
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py index 7769f3ff72..119f07276e 100644 --- a/scripts/lib/wic/utils/oe/misc.py +++ b/scripts/lib/wic/utils/oe/misc.py | |||
@@ -28,7 +28,7 @@ | |||
28 | from wic import msger | 28 | from wic import msger |
29 | from wic.utils import runner | 29 | from wic.utils import runner |
30 | 30 | ||
31 | def __exec_cmd(cmd_and_args, as_shell = False, catch = 3): | 31 | def __exec_cmd(cmd_and_args, as_shell=False, catch=3): |
32 | """ | 32 | """ |
33 | Execute command, catching stderr, stdout | 33 | Execute command, catching stderr, stdout |
34 | 34 | ||
@@ -49,7 +49,7 @@ def __exec_cmd(cmd_and_args, as_shell = False, catch = 3): | |||
49 | return (rc, out) | 49 | return (rc, out) |
50 | 50 | ||
51 | 51 | ||
52 | def exec_cmd(cmd_and_args, as_shell = False, catch = 3): | 52 | def exec_cmd(cmd_and_args, as_shell=False, catch=3): |
53 | """ | 53 | """ |
54 | Execute command, catching stderr, stdout | 54 | Execute command, catching stderr, stdout |
55 | 55 | ||
@@ -63,7 +63,7 @@ def exec_cmd(cmd_and_args, as_shell = False, catch = 3): | |||
63 | return out | 63 | return out |
64 | 64 | ||
65 | 65 | ||
66 | def exec_cmd_quiet(cmd_and_args, as_shell = False): | 66 | def exec_cmd_quiet(cmd_and_args, as_shell=False): |
67 | """ | 67 | """ |
68 | Execute command, catching nothing in the output | 68 | Execute command, catching nothing in the output |
69 | 69 | ||
@@ -72,7 +72,7 @@ def exec_cmd_quiet(cmd_and_args, as_shell = False): | |||
72 | return exec_cmd(cmd_and_args, as_shell, 0) | 72 | return exec_cmd(cmd_and_args, as_shell, 0) |
73 | 73 | ||
74 | 74 | ||
75 | def exec_native_cmd(cmd_and_args, native_sysroot, catch = 3): | 75 | def exec_native_cmd(cmd_and_args, native_sysroot, catch=3): |
76 | """ | 76 | """ |
77 | Execute native command, catching stderr, stdout | 77 | Execute native command, catching stderr, stdout |
78 | 78 | ||
diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index bb99c6a6c1..b9fbc16e12 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py | |||
@@ -86,9 +86,9 @@ class Image: | |||
86 | self.partitions.append(part) | 86 | self.partitions.append(part) |
87 | self.__add_disk(part['disk_name']) | 87 | self.__add_disk(part['disk_name']) |
88 | 88 | ||
89 | def add_partition(self, size, disk_name, mountpoint, source_file = None, fstype = None, | 89 | def add_partition(self, size, disk_name, mountpoint, source_file=None, fstype=None, |
90 | label=None, fsopts = None, boot = False, align = None, no_table=False, | 90 | label=None, fsopts=None, boot=False, align=None, no_table=False, |
91 | part_type = None): | 91 | part_type=None): |
92 | """ Add the next partition. Prtitions have to be added in the | 92 | """ Add the next partition. Prtitions have to be added in the |
93 | first-to-last order. """ | 93 | first-to-last order. """ |
94 | 94 | ||
@@ -116,7 +116,7 @@ class Image: | |||
116 | 116 | ||
117 | self.__add_partition(part) | 117 | self.__add_partition(part) |
118 | 118 | ||
119 | def layout_partitions(self, ptable_format = "msdos"): | 119 | def layout_partitions(self, ptable_format="msdos"): |
120 | """ Layout the partitions, meaning calculate the position of every | 120 | """ Layout the partitions, meaning calculate the position of every |
121 | partition on the disk. The 'ptable_format' parameter defines the | 121 | partition on the disk. The 'ptable_format' parameter defines the |
122 | partition table format and may be "msdos". """ | 122 | partition table format and may be "msdos". """ |
diff --git a/scripts/wic b/scripts/wic index 524156ddc5..dcf1a5520e 100755 --- a/scripts/wic +++ b/scripts/wic | |||
@@ -79,28 +79,28 @@ def wic_create_subcommand(args, usage_str): | |||
79 | Command-line handling for image creation. The real work is done | 79 | Command-line handling for image creation. The real work is done |
80 | by image.engine.wic_create() | 80 | by image.engine.wic_create() |
81 | """ | 81 | """ |
82 | parser = optparse.OptionParser(usage = usage_str) | 82 | parser = optparse.OptionParser(usage=usage_str) |
83 | 83 | ||
84 | parser.add_option("-o", "--outdir", dest = "outdir", | 84 | parser.add_option("-o", "--outdir", dest="outdir", |
85 | action = "store", help = "name of directory to create image in") | 85 | action="store", help="name of directory to create image in") |
86 | parser.add_option("-i", "--infile", dest = "properties_file", | 86 | parser.add_option("-i", "--infile", dest="properties_file", |
87 | action = "store", help = "name of file containing the values for image properties as a JSON file") | 87 | action="store", help="name of file containing the values for image properties as a JSON file") |
88 | parser.add_option("-e", "--image-name", dest = "image_name", | 88 | parser.add_option("-e", "--image-name", dest="image_name", |
89 | action = "store", help = "name of the image to use the artifacts from e.g. core-image-sato") | 89 | action="store", help="name of the image to use the artifacts from e.g. core-image-sato") |
90 | parser.add_option("-r", "--rootfs-dir", dest = "rootfs_dir", | 90 | parser.add_option("-r", "--rootfs-dir", dest="rootfs_dir", |
91 | action = "callback", callback = callback_rootfs_dir, type = "string", | 91 | action="callback", callback=callback_rootfs_dir, type="string", |
92 | help = "path to the /rootfs dir to use as the .wks rootfs source") | 92 | help="path to the /rootfs dir to use as the .wks rootfs source") |
93 | parser.add_option("-b", "--bootimg-dir", dest = "bootimg_dir", | 93 | parser.add_option("-b", "--bootimg-dir", dest="bootimg_dir", |
94 | action = "store", help = "path to the dir containing the boot artifacts (e.g. /EFI or /syslinux dirs) to use as the .wks bootimg source") | 94 | action="store", help="path to the dir containing the boot artifacts (e.g. /EFI or /syslinux dirs) to use as the .wks bootimg source") |
95 | parser.add_option("-k", "--kernel-dir", dest = "kernel_dir", | 95 | parser.add_option("-k", "--kernel-dir", dest="kernel_dir", |
96 | action = "store", help = "path to the dir containing the kernel to use in the .wks bootimg") | 96 | action="store", help="path to the dir containing the kernel to use in the .wks bootimg") |
97 | parser.add_option("-n", "--native-sysroot", dest = "native_sysroot", | 97 | parser.add_option("-n", "--native-sysroot", dest="native_sysroot", |
98 | action = "store", help = "path to the native sysroot containing the tools to use to build the image") | 98 | action="store", help="path to the native sysroot containing the tools to use to build the image") |
99 | parser.add_option("-p", "--skip-build-check", dest = "build_check", | 99 | parser.add_option("-p", "--skip-build-check", dest="build_check", |
100 | action = "store_false", default = True, help = "skip the build check") | 100 | action="store_false", default=True, help="skip the build check") |
101 | parser.add_option("-f", "--build-rootfs", action="store_true", help = "build rootfs") | 101 | parser.add_option("-f", "--build-rootfs", action="store_true", help="build rootfs") |
102 | parser.add_option("-D", "--debug", dest = "debug", action = "store_true", | 102 | parser.add_option("-D", "--debug", dest="debug", action="store_true", |
103 | default = False, help = "output debug information") | 103 | default=False, help="output debug information") |
104 | 104 | ||
105 | (options, args) = parser.parse_args(args) | 105 | (options, args) = parser.parse_args(args) |
106 | 106 | ||
@@ -223,11 +223,11 @@ def wic_list_subcommand(args, usage_str): | |||
223 | Command-line handling for listing available image properties and | 223 | Command-line handling for listing available image properties and |
224 | values. The real work is done by image.engine.wic_list() | 224 | values. The real work is done by image.engine.wic_list() |
225 | """ | 225 | """ |
226 | parser = optparse.OptionParser(usage = usage_str) | 226 | parser = optparse.OptionParser(usage=usage_str) |
227 | 227 | ||
228 | parser.add_option("-o", "--outfile", action = "store", | 228 | parser.add_option("-o", "--outfile", action="store", |
229 | dest = "properties_file", | 229 | dest="properties_file", |
230 | help = "dump the possible values for image properties to a JSON file") | 230 | help="dump the possible values for image properties to a JSON file") |
231 | 231 | ||
232 | (options, args) = parser.parse_args(args) | 232 | (options, args) = parser.parse_args(args) |
233 | 233 | ||
@@ -276,12 +276,12 @@ subcommands = { | |||
276 | 276 | ||
277 | 277 | ||
278 | def start_logging(loglevel): | 278 | def start_logging(loglevel): |
279 | logging.basicConfig(filname = 'wic.log', filemode = 'w', level=loglevel) | 279 | logging.basicConfig(filname='wic.log', filemode='w', level=loglevel) |
280 | 280 | ||
281 | 281 | ||
282 | def main(): | 282 | def main(): |
283 | parser = optparse.OptionParser(version = "wic version %s" % __version__, | 283 | parser = optparse.OptionParser(version="wic version %s" % __version__, |
284 | usage = wic_usage) | 284 | usage=wic_usage) |
285 | 285 | ||
286 | parser.disable_interspersed_args() | 286 | parser.disable_interspersed_args() |
287 | 287 | ||