From patchwork Mon Jan 7 14:51:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milo Casagrande X-Patchwork-Id: 13886 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C703D23E1F for ; Mon, 7 Jan 2013 14:51:21 +0000 (UTC) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by fiordland.canonical.com (Postfix) with ESMTP id 54CFDA19422 for ; Mon, 7 Jan 2013 14:51:21 +0000 (UTC) Received: by mail-vb0-f44.google.com with SMTP id fc26so19382587vbb.17 for ; Mon, 07 Jan 2013 06:51:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:content-type:mime-version:x-launchpad-project :x-launchpad-branch:x-launchpad-message-rationale :x-launchpad-branch-revision-number:x-launchpad-notification-type:to :from:subject:message-id:date:reply-to:sender:errors-to:precedence :x-generated-by:x-launchpad-hash:x-gm-message-state; bh=ASy19bCBID7ZBe6dUVV+1y4V0Fgy5+/G0OFmS9uhqKE=; b=na0GscRjj5CwVMyxd6FWfOvG5nLfaSSQdVN8OZ9V15mAXj7JRveGD3z7M92PFFjM1u vBX3v1xYmnwQZKN1pgZQrQZdSE+gsziQJnv+aJKKzZYYWBYp94Aka4NS7DfLNwxgEbZ6 n1fKQEeTh9Yjl9mzQo05l8BBPrFjGPE4L2taptdFDbGjVltbRunboN/dWqlDjwAutK45 eqcVuXFHaHu4R7nq9tEukcAur90UH7ZSk33o9yAhfMAWfnupN62ByrAKDRvuRbvN5Tv4 p+Y3ZnGOYfkEMEuMLtxx109iBxLESO8IQOFqHkTuB3VjNscwv3I6Q4EqeUBIKBT2epUj Ts+A== X-Received: by 10.220.238.139 with SMTP id ks11mr81246804vcb.49.1357570280776; Mon, 07 Jan 2013 06:51:20 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp64428veb; Mon, 7 Jan 2013 06:51:19 -0800 (PST) X-Received: by 10.180.99.72 with SMTP id eo8mr9742546wib.34.1357570277758; Mon, 07 Jan 2013 06:51:17 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id gb1si88606885wjb.18.2013.01.07.06.51.17 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 06:51:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1TsE2n-0007SU-1O for ; Mon, 07 Jan 2013 14:51:17 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 0DDCDE0420 for ; Mon, 7 Jan 2013 14:51:15 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: linaro-image-tools X-Launchpad-Branch: ~linaro-image-tools/linaro-image-tools/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 597 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 597: Refactored and unified variable names. Message-Id: <20130107145115.21683.25883.launchpad@ackee.canonical.com> Date: Mon, 07 Jan 2013 14:51:15 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="16402"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 955ff7030bbffc0e762d18adeaa6836ebebcaa41 X-Gm-Message-State: ALoCoQmlaaYtuftHLmzp71Ndqd2HaELK6Iib19tddnNoZKtoiK9g6w4bCLsciPLGg1BRJAdNkvQs Merge authors: Milo Casagrande (milo) Related merge proposals: https://code.launchpad.net/~milo/linaro-image-tools/var-refactoring/+merge/142093 proposed by: Milo Casagrande (milo) review: Approve - James Tunnicliffe (dooferlad) ------------------------------------------------------------ revno: 597 [merge] committer: Milo Casagrande branch nick: trunk timestamp: Mon 2013-01-07 15:50:17 +0100 message: Refactored and unified variable names. modified: linaro_image_tools/media_create/android_boards.py linaro_image_tools/media_create/boards.py --- lp:linaro-image-tools https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk You are subscribed to branch lp:linaro-image-tools. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription === modified file 'linaro_image_tools/media_create/android_boards.py' --- linaro_image_tools/media_create/android_boards.py 2013-01-03 13:55:33 +0000 +++ linaro_image_tools/media_create/android_boards.py 2013-01-07 12:40:41 +0000 @@ -170,15 +170,15 @@ if self.extra_boot_args_options: boot_args_options += ' %s' % self.extra_boot_args_options boot_args_options += ' %s' % self.android_specific_args - serial_opts = self.extra_serial_options + serial_options = self.extra_serial_options for console in consoles: - serial_opts += ' console=%s' % console + serial_options += ' console=%s' % console replacements = dict( - serial_opts=serial_opts, + serial_options=serial_options, boot_args_options=boot_args_options) return ( - "%(serial_opts)s " + "%(serial_options)s " "%(boot_args_options)s" % replacements) @@ -391,13 +391,13 @@ self._android_specific_args = 'init=/init androidboot.console=%s' def _get_extra_serial_options(self): - serial_opts = self._extra_serial_options - if serial_opts: - if isinstance(serial_opts, list): - serial_opts = ' '.join(serial_opts) - if self._check_placeholder_presence(serial_opts, '%s'): - serial_opts = serial_opts % self.serial_tty - return serial_opts + serial_options = self._extra_serial_options + if serial_options: + if isinstance(serial_options, list): + serial_options = ' '.join(serial_options) + if self._check_placeholder_presence(serial_options, '%s'): + serial_options = serial_options % self.serial_tty + return serial_options def _set_extra_serial_options(self, value): self._extra_serial_options = value === modified file 'linaro_image_tools/media_create/boards.py' --- linaro_image_tools/media_create/boards.py 2013-01-02 14:38:13 +0000 +++ linaro_image_tools/media_create/boards.py 2013-01-07 12:40:41 +0000 @@ -151,7 +151,7 @@ # placeholders in the string for dinamically change values. But this # is done only for hwpack v1. self._extra_serial_options = '' - self._live_serial_opts = '' + self._live_serial_options = '' self.board = None self.boot_script = None self.bootloader_dd = False @@ -211,16 +211,17 @@ self.initrd = None # XXX: can be removed when killing v1 hwpack. - def _get_live_serial_opts(self): - return_value = self._live_serial_opts + def _get_live_serial_options(self): + return_value = self._live_serial_options if self._check_placeholder_presence(return_value, r'%s'): - return_value = self._live_serial_opts % self.serial_tty + return_value = self._live_serial_options % self.serial_tty return return_value - def _set_live_serial_opts(self, value): - self._live_serial_opts = value + def _set_live_serial_options(self, value): + self._live_serial_options = value - live_serial_opts = property(_get_live_serial_opts, _set_live_serial_opts) + live_serial_options = property(_get_live_serial_options, + _set_live_serial_options) # XXX: can be removed when killing v1 hwpack. def _get_extra_serial_options(self): @@ -233,7 +234,7 @@ self._extra_serial_options = value extra_serial_options = property(_get_extra_serial_options, - _set_extra_serial_options) + _set_extra_serial_options) def get_metadata_field(self, field_name): """ Return the metadata value for field_name if it can be found. @@ -540,24 +541,24 @@ boot_args_options = 'rootwait ro' if self.extra_boot_args_options: boot_args_options += ' %s' % self.extra_boot_args_options - serial_opts = self.extra_serial_options + serial_options = self.extra_serial_options for console in consoles: - serial_opts += ' console=%s' % console + serial_options += ' console=%s' % console lowmem_opt = '' boot_snippet = 'root=%s' % rootfs_id if is_live: - serial_opts += ' %s' % self.live_serial_opts + serial_options += ' %s' % self.live_serial_options boot_snippet = 'boot=casper' if is_lowmem: lowmem_opt = 'only-ubiquity' replacements = dict( - serial_opts=serial_opts, + serial_options=serial_options, lowmem_opt=lowmem_opt, boot_snippet=boot_snippet, boot_args_options=boot_args_options) return ( - "%(serial_opts)s %(lowmem_opt)s " + "%(serial_options)s %(lowmem_opt)s " "%(boot_snippet)s %(boot_args_options)s" % replacements) @@ -946,7 +947,7 @@ self.load_addr = '0x80008000' self._serial_tty = 'ttyO2' self._extra_serial_options = 'console=tty0 console=%s,115200n8' - self._live_serial_opts = 'serialtty=%s' + self._live_serial_options = 'serialtty=%s' class OveroConfig(OmapConfig): @@ -981,7 +982,7 @@ self.kernel_addr = '0x80200000' self.load_addr = '0x80008000' self._extra_serial_options = 'console=tty0 console=%s,115200n8' - self._live_serial_opts = 'serialtty=%s' + self._live_serial_options = 'serialtty=%s' class IgepConfig(BeagleConfig): @@ -1020,7 +1021,7 @@ self.mmc_option = '1:1' self.serial_tty = 'ttyAMA2' self._extra_serial_options = 'console=tty0 console=%s,115200n8' - self._live_serial_opts = 'serialtty=%s' + self._live_serial_options = 'serialtty=%s' def _make_boot_files(self, boot_env, chroot_dir, boot_dir, boot_device_or_file, k_img_data, i_img_data, @@ -1231,7 +1232,7 @@ self.mmc_part_offset = 1 self.serial_tty = 'ttymxc0' self._extra_serial_options = 'console=tty0 console=%s,115200n8' - self._live_serial_opts = 'serialtty=%s' + self._live_serial_options = 'serialtty=%s' def get_v1_sfdisk_cmd(self, should_align_boot_part=None): """Return the sfdisk command to partition the media. @@ -1342,7 +1343,7 @@ self.load_addr = '0x60008000' self.serial_tty = 'ttyAMA0' self._extra_serial_options = 'console=tty0 console=%s,38400n8' - self._live_serial_opts = 'serialtty=%s' + self._live_serial_options = 'serialtty=%s' def _make_boot_files(self, boot_env, chroot_dir, boot_dir, boot_device_or_file, k_img_data, i_img_data, @@ -1588,7 +1589,7 @@ self.kernel_flavors = ['generic', 'pae'] self.serial_tty = 'ttyS0' self._extra_serial_options = 'console=tty0 console=%s,115200n8' - self._live_serial_opts = 'serialtty=%s' + self._live_serial_options = 'serialtty=%s' def _make_boot_files(self, boot_env, chroot_dir, boot_dir, boot_device_or_file, k_img_data, i_img_data,