summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@intel.com>2013-04-09 15:34:00 +0300
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2013-04-19 16:03:53 +0300
commit68a2c4f24b20f895f83a47823a396b97911753a4 (patch)
treebc085e1405b292daf39c620f3c23c553ec9afeb6
parent47703e45015419d2641a4b905b28b7e3baad8ebe (diff)
downloadmic-68a2c4f24b20f895f83a47823a396b97911753a4.tar.gz
mic-68a2c4f24b20f895f83a47823a396b97911753a4.tar.bz2
mic-68a2c4f24b20f895f83a47823a396b97911753a4.zip
gpt_parser: use _ for private variables
The standard convention in python that all the internal variables in a module start with an underscore symbol. Change-Id: I38e4ed6d9fc749c43f8c4909320b0415ba3ebba9 Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
-rw-r--r--mic/utils/gpt_parser.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/mic/utils/gpt_parser.py b/mic/utils/gpt_parser.py
index cbf1097..425f4a8 100644
--- a/mic/utils/gpt_parser.py
+++ b/mic/utils/gpt_parser.py
@@ -22,8 +22,8 @@ import struct
import uuid
from mic.utils.errors import MountError
-GPT_HEADER_FORMAT = "<8sIIIIQQQQ16sQIII420x"
-GPT_ENTRY_FORMAT = "<16s16sQQQ72s"
+_GPT_HEADER_FORMAT = "<8sIIIIQQQQ16sQIII420x"
+_GPT_ENTRY_FORMAT = "<16s16sQQQ72s"
def _stringify_uuid(binary_uuid):
""" A small helper function to transform a binary UUID into a string
@@ -73,12 +73,12 @@ class GptParser:
# The header sits at LBA 1 - read it
self.disk_obj.seek(self.sector_size)
try:
- header = self.disk_obj.read(struct.calcsize(GPT_HEADER_FORMAT))
+ header = self.disk_obj.read(struct.calcsize(_GPT_HEADER_FORMAT))
except IOError as err:
raise MountError("cannot read from file '%s': %s" % \
(self.disk_path, err))
- header = struct.unpack(GPT_HEADER_FORMAT, header)
+ header = struct.unpack(_GPT_HEADER_FORMAT, header)
# Perform a simple validation
if header[0] != 'EFI PART':
@@ -116,8 +116,8 @@ class GptParser:
self.disk_obj.seek(entries_start)
for _ in xrange(0, entries_count):
- entry = self.disk_obj.read(struct.calcsize(GPT_ENTRY_FORMAT))
- entry = struct.unpack(GPT_ENTRY_FORMAT, entry)
+ entry = self.disk_obj.read(struct.calcsize(_GPT_ENTRY_FORMAT))
+ entry = struct.unpack(_GPT_ENTRY_FORMAT, entry)
if entry[2] == 0 or entry[3] == 0:
continue