From 724a1aa53546d55df97a9d08740287b4335eeaad Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Thu, 11 Apr 2013 12:19:57 +0300 Subject: [PATCH] gpt_parser: improve naming some more Use "raw_" prefix for the on-disk data to make the code more readable. Change-Id: I644f6250ddc3f6483910b94242f06c49c64b5e75 Signed-off-by: Artem Bityutskiy --- mic/utils/gpt_parser.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mic/utils/gpt_parser.py b/mic/utils/gpt_parser.py index 4f7efa3..84ecd10 100644 --- a/mic/utils/gpt_parser.py +++ b/mic/utils/gpt_parser.py @@ -196,22 +196,22 @@ class GptParser: index = -1 for _ in xrange(0, header['parts_cnt']): - entry = self._read_disk(start, _GPT_ENTRY_SIZE) - entry = struct.unpack(_GPT_ENTRY_FORMAT, entry) + raw_entry = self._read_disk(start, _GPT_ENTRY_SIZE) + raw_entry = struct.unpack(_GPT_ENTRY_FORMAT, raw_entry) start += header['entry_size'] index += 1 - if entry[2] == 0 or entry[3] == 0: + if raw_entry[2] == 0 or raw_entry[3] == 0: continue - part_name = str(entry[5].decode('UTF-16').split('\0', 1)[0]) + part_name = str(raw_entry[5].decode('UTF-16').split('\0', 1)[0]) yield { 'index' : index, - 'type_uuid' : _stringify_uuid(entry[0]), - 'part_uuid' : _stringify_uuid(entry[1]), - 'first_lba' : entry[2], - 'last_lba' : entry[3], - 'flags' : entry[4], + 'type_uuid' : _stringify_uuid(raw_entry[0]), + 'part_uuid' : _stringify_uuid(raw_entry[1]), + 'first_lba' : raw_entry[2], + 'last_lba' : raw_entry[3], + 'flags' : raw_entry[4], 'name' : part_name, 'primary' : primary } -- 2.7.4