diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 597: Refactored and unified variable names.

Message ID 20130107145115.21683.25883.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Milo Casagrande Jan. 7, 2013, 2:51 p.m. UTC
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 <milo@ubuntu.com>
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
diff mbox

Patch

=== 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,