From a09395932d997d41f59ae3ee2f7f77f91f5caa02 Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Tue, 19 Dec 2017 16:01:38 +0800 Subject: BaseTools: Support nest field name in DSC/DEC Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C Reviewed-by: Liming Gao --- BaseTools/Source/Python/Workspace/DscBuildData.py | 25 ++++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'BaseTools/Source/Python/Workspace/DscBuildData.py') diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 23c2c0d410..4642e761b9 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1207,18 +1207,19 @@ class DscBuildData(PlatformBuildClassObject): def get_length(value): Value = value.strip() - if Value.startswith('GUID') and Value.endswith(')'): - return 16 - if Value.startswith('L"') and Value.endswith('"'): - return len(Value[2:-1]) - if Value[0] == '"' and Value[-1] == '"': - return len(Value) - 2 - if Value[0] == '{' and Value[-1] == '}': - return len(Value.split(",")) - if Value.startswith("L'") and Value.endswith("'") and len(list(Value[2:-1])) > 1: - return len(list(Value[2:-1])) - if Value[0] == "'" and Value[-1] == "'" and len(list(Value[1:-1])) > 1: - return len(Value) - 2 + if len(value) > 1: + if Value.startswith('GUID') and Value.endswith(')'): + return 16 + if Value.startswith('L"') and Value.endswith('"'): + return len(Value[2:-1]) + if Value[0] == '"' and Value[-1] == '"': + return len(Value) - 2 + if Value[0] == '{' and Value[-1] == '}': + return len(Value.split(",")) + if Value.startswith("L'") and Value.endswith("'") and len(list(Value[2:-1])) > 1: + return len(list(Value[2:-1])) + if Value[0] == "'" and Value[-1] == "'" and len(list(Value[1:-1])) > 1: + return len(Value) - 2 return len(Value) return str(max([pcd_size for pcd_size in [get_length(item) for item in sku_values]])) -- cgit v1.2.3