diff options
Diffstat (limited to 'scripts/lib')
-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 |
8 files changed, 31 insertions, 31 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): def __del__(self): self.cleanup() - def __init__(self, createopts = None): + def __init__(self, createopts=None): """Initialize an ImageCreator instance. ks -- a pykickstart.KickstartParser instance; this instance will be @@ -131,8 +131,8 @@ class BaseImageCreator(object): self.workdir = os.path.join(self.tmpdir, "build") if not os.path.exists(self.workdir): os.makedirs(self.workdir) - self.__builddir = tempfile.mkdtemp(dir = self.workdir, - prefix = "imgcreate-") + self.__builddir = tempfile.mkdtemp(dir=self.workdir, + prefix="imgcreate-") except OSError, (err, msg): raise CreatorError("Failed create build directory in %s: %s" % (self.tmpdir, msg)) @@ -178,7 +178,7 @@ class BaseImageCreator(object): self._cleanup() - shutil.rmtree(self.__builddir, ignore_errors = True) + shutil.rmtree(self.__builddir, ignore_errors=True) self.__builddir = None 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): p.source_file, p.fstype, p.label, - fsopts = p.fsopts, - boot = p.active, - align = p.align, - no_table = p.no_table, - part_type = p.part_type) + fsopts=p.fsopts, + boot=p.active, + align=p.align, + no_table=p.no_table, + part_type=p.part_type) self._restore_fstab(fstab) 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): return ks -def get_image_size(ks, default = None): +def get_image_size(ks, default=None): __size = 0 for p in ks.handler.partition.partitions: if p.mountpoint == "/" and p.size: @@ -78,40 +78,40 @@ def get_image_size(ks, default = None): else: return default -def get_image_fstype(ks, default = None): +def get_image_fstype(ks, default=None): for p in ks.handler.partition.partitions: if p.mountpoint == "/" and p.fstype: return p.fstype return default -def get_image_fsopts(ks, default = None): +def get_image_fsopts(ks, default=None): for p in ks.handler.partition.partitions: if p.mountpoint == "/" and p.fsopts: return p.fsopts return default -def get_timeout(ks, default = None): +def get_timeout(ks, default=None): if not hasattr(ks.handler.bootloader, "timeout"): return default if ks.handler.bootloader.timeout is None: return default return int(ks.handler.bootloader.timeout) -def get_kernel_args(ks, default = "ro rd.live.image"): +def get_kernel_args(ks, default="ro rd.live.image"): if not hasattr(ks.handler.bootloader, "appendLine"): return default if ks.handler.bootloader.appendLine is None: return default return "%s %s" %(default, ks.handler.bootloader.appendLine) -def get_menu_args(ks, default = ""): +def get_menu_args(ks, default=""): if not hasattr(ks.handler.bootloader, "menus"): return default if ks.handler.bootloader.menus in (None, ""): return default return "%s" % ks.handler.bootloader.menus -def get_default_kernel(ks, default = None): +def get_default_kernel(ks, default=None): if not hasattr(ks.handler.bootloader, "default"): return default 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 CATCHERR_BUFFILE_PATH = None CATCHERR_SAVED_2 = -1 -def _general_print(head, color, msg = None, stream = None, level = 'normal'): +def _general_print(head, color, msg=None, stream=None, level='normal'): global LOG_CONTENT if not stream: stream = sys.stdout @@ -130,7 +130,7 @@ def _color_print(head, color, msg, stream, level): stream.flush() -def _color_perror(head, color, msg, level = 'normal'): +def _color_perror(head, color, msg, level='normal'): if CATCHERR_BUFFILE_FD > 0: _general_print(head, color, msg, sys.stdout, level) else: @@ -190,7 +190,7 @@ def info(msg): def verbose(msg): head, msg = _split_msg('Verbose', msg) - _general_print(head, INFO_COLOR, msg, level = 'verbose') + _general_print(head, INFO_COLOR, msg, level='verbose') def warning(msg): head, msg = _split_msg('Warning', msg) @@ -198,7 +198,7 @@ def warning(msg): def debug(msg): head, msg = _split_msg('Debug', msg) - _color_perror(head, ERR_COLOR, msg, level = 'debug') + _color_perror(head, ERR_COLOR, msg, level='debug') def error(msg): head, msg = _split_msg('Error', msg) @@ -299,7 +299,7 @@ def disable_logstderr(): global CATCHERR_BUFFILE_PATH global CATCHERR_SAVED_2 - raw(msg = None) # flush message buffer and print it. + raw(msg=None) # flush message buffer and print it. os.dup2(CATCHERR_SAVED_2, 2) os.close(CATCHERR_SAVED_2) 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: """ Generic base object for a disk. """ - def __init__(self, size, device = None): + def __init__(self, size, device=None): self._device = device self._size = size 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 @@ import os import time -def build_name(kscfg, release=None, prefix = None, suffix = None): +def build_name(kscfg, release=None, prefix=None, suffix=None): """Construct and return an image name string. 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 @@ from wic import msger from wic.utils import runner -def __exec_cmd(cmd_and_args, as_shell = False, catch = 3): +def __exec_cmd(cmd_and_args, as_shell=False, catch=3): """ Execute command, catching stderr, stdout @@ -49,7 +49,7 @@ def __exec_cmd(cmd_and_args, as_shell = False, catch = 3): return (rc, out) -def exec_cmd(cmd_and_args, as_shell = False, catch = 3): +def exec_cmd(cmd_and_args, as_shell=False, catch=3): """ Execute command, catching stderr, stdout @@ -63,7 +63,7 @@ def exec_cmd(cmd_and_args, as_shell = False, catch = 3): return out -def exec_cmd_quiet(cmd_and_args, as_shell = False): +def exec_cmd_quiet(cmd_and_args, as_shell=False): """ Execute command, catching nothing in the output @@ -72,7 +72,7 @@ def exec_cmd_quiet(cmd_and_args, as_shell = False): return exec_cmd(cmd_and_args, as_shell, 0) -def exec_native_cmd(cmd_and_args, native_sysroot, catch = 3): +def exec_native_cmd(cmd_and_args, native_sysroot, catch=3): """ Execute native command, catching stderr, stdout 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: self.partitions.append(part) self.__add_disk(part['disk_name']) - def add_partition(self, size, disk_name, mountpoint, source_file = None, fstype = None, - label=None, fsopts = None, boot = False, align = None, no_table=False, - part_type = None): + def add_partition(self, size, disk_name, mountpoint, source_file=None, fstype=None, + label=None, fsopts=None, boot=False, align=None, no_table=False, + part_type=None): """ Add the next partition. Prtitions have to be added in the first-to-last order. """ @@ -116,7 +116,7 @@ class Image: self.__add_partition(part) - def layout_partitions(self, ptable_format = "msdos"): + def layout_partitions(self, ptable_format="msdos"): """ Layout the partitions, meaning calculate the position of every partition on the disk. The 'ptable_format' parameter defines the partition table format and may be "msdos". """ |