summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen
diff options
context:
space:
mode:
authorCarsey, Jaben <jaben.carsey@intel.com>2018-04-28 06:32:19 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-05-04 13:02:59 +0800
commitdea5ef9dc41c5d7a1a6b20a9457433faf92cc623 (patch)
tree7223d338fe3e3969393b42cd43fd907767ae7e2f /BaseTools/Source/Python/AutoGen
parent18011927b1b9083df1dae4a271cb2492c4438ab8 (diff)
downloadedk2-dea5ef9dc41c5d7a1a6b20a9457433faf92cc623.tar.gz
edk2-dea5ef9dc41c5d7a1a6b20a9457433faf92cc623.tar.bz2
edk2-dea5ef9dc41c5d7a1a6b20a9457433faf92cc623.zip
BaseTools: AutoGen - refactor assemble_variable
make this function @staticmethod since self parameter is not used. change valuelist to valuedict since it is a dictionary. 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/GenVar.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/Python/AutoGen/GenVar.py
index 13bcf99b26..b8f40da9a3 100644
--- a/BaseTools/Source/Python/AutoGen/GenVar.py
+++ b/BaseTools/Source/Python/AutoGen/GenVar.py
@@ -113,9 +113,10 @@ class VariableMgr(object):
indexedvarinfo[key] = [var_info(n.pcdindex,n.pcdname,n.defaultstoragename,n.skuname,n.var_name, n.var_guid, "0x00",n.var_attribute,newvaluestr , newvaluestr , DataType.TAB_VOID)]
self.VarInfo = [item[0] for item in indexedvarinfo.values()]
- def assemble_variable(self, valuelist):
- ordered_offset = sorted(valuelist.keys())
- ordered_value = [valuelist[k] for k in ordered_offset]
+ @staticmethod
+ def assemble_variable(valuedict):
+ ordered_offset = sorted(valuedict.keys())
+ ordered_value = [valuedict[k] for k in ordered_offset]
var_value = []
num = 0
for offset in ordered_offset:
@@ -126,6 +127,7 @@ class VariableMgr(object):
var_value += ordered_value[num]
num +=1
return var_value
+
def process_variable_data(self):
var_data = collections.defaultdict(collections.OrderedDict)