diff options
author | Carsey, Jaben <jaben.carsey@intel.com> | 2018-04-28 06:32:33 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-05-04 13:03:06 +0800 |
commit | def89ed0256fd903dbd1c54aa756fcb1fb5842df (patch) | |
tree | 690a24eaee20864fa120928856bf593c7d106915 /BaseTools/Source/Python/AutoGen | |
parent | 5565a8c4d2196b5e55e702169feefeeb07a330d9 (diff) | |
download | edk2-def89ed0256fd903dbd1c54aa756fcb1fb5842df.tar.gz edk2-def89ed0256fd903dbd1c54aa756fcb1fb5842df.tar.bz2 edk2-def89ed0256fd903dbd1c54aa756fcb1fb5842df.zip |
BaseTools: AutoGen - refactor out functions only called in __init__
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py index 2f8f4fac23..0b4677b62a 100644 --- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py +++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py @@ -244,16 +244,12 @@ class VAR_CHECK_PCD_VALID_OBJ(object): self.Type = 1
self.Length = 0 # Length include this header
self.VarOffset = VarOffset
- self.StorageWidth = 0
self.PcdDataType = PcdDataType.strip()
self.rawdata = data
self.data = set()
- self.ValidData = True
- self.updateStorageWidth()
-
- def updateStorageWidth(self):
try:
self.StorageWidth = MAX_SIZE_TYPE[self.PcdDataType]
+ self.ValidData = True
except:
self.StorageWidth = 0
self.ValidData = False
@@ -265,9 +261,6 @@ class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OBJ): def __init__(self, VarOffset, validlist, PcdDataType):
super(VAR_CHECK_PCD_VALID_LIST, self).__init__(VarOffset, validlist, PcdDataType)
self.Type = 1
- self.update_data()
- self.update_size()
- def update_data(self):
valid_num_list = []
data_list = []
for item in self.rawdata:
@@ -283,8 +276,6 @@ class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OBJ): self.data = set(data_list)
-
- def update_size(self):
self.Length = 5 + len(self.data) * self.StorageWidth
@@ -292,9 +283,6 @@ class VAR_CHECK_PCD_VALID_RANGE(VAR_CHECK_PCD_VALID_OBJ): def __init__(self, VarOffset, validrange, PcdDataType):
super(VAR_CHECK_PCD_VALID_RANGE, self).__init__(VarOffset, validrange, PcdDataType)
self.Type = 2
- self.update_data()
- self.update_size()
- def update_data(self):
RangeExpr = ""
data_list = []
i = 0
@@ -308,8 +296,6 @@ class VAR_CHECK_PCD_VALID_RANGE(VAR_CHECK_PCD_VALID_OBJ): for obj in rangelist.pop():
data_list.append((obj.start, obj.end))
self.data = set(data_list)
-
- def update_size(self):
self.Length = 5 + len(self.data) * 2 * self.StorageWidth
|