summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/UPT/Library/UniClassObject.py
diff options
context:
space:
mode:
authorHess Chen <hesheng.chen@intel.com>2016-07-29 10:30:56 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-08-03 10:49:31 +0800
commit645a51287e9519eb4c6d27b4e4f11d0556a624e8 (patch)
treec45139eb17cd0bc7ce985ebd4aa40aa28d9c3258 /BaseTools/Source/Python/UPT/Library/UniClassObject.py
parent6cf9903481f07859cb0013598d2d13309d4e4644 (diff)
downloadedk2-platforms-645a51287e9519eb4c6d27b4e4f11d0556a624e8.tar.xz
BaseTool/Upt: Add support for Private
Support new syntax in package DEC file as below: [Includes.Common.Private] [Ppis.Common.Private] [Guids.Common.Private] [Protocols.Common.Private] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/UPT/Library/UniClassObject.py')
-rw-r--r--BaseTools/Source/Python/UPT/Library/UniClassObject.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/BaseTools/Source/Python/UPT/Library/UniClassObject.py b/BaseTools/Source/Python/UPT/Library/UniClassObject.py
index 1e73d3e9a8..27804cc9d8 100644
--- a/BaseTools/Source/Python/UPT/Library/UniClassObject.py
+++ b/BaseTools/Source/Python/UPT/Library/UniClassObject.py
@@ -328,11 +328,11 @@ class UniFileClassObject(object):
Lang = distutils.util.split_quoted((Line.split(u"//")[0]))
if len(Lang) != 3:
try:
- FileIn = codecs.open(File.Path, mode='rb', encoding='utf_8').read()
+ FileIn = codecs.open(File.Path, mode='rb', encoding='utf_8').readlines()
except UnicodeError, Xstr:
- FileIn = codecs.open(File.Path, mode='rb', encoding='utf_16').read()
+ FileIn = codecs.open(File.Path, mode='rb', encoding='utf_16').readlines()
except UnicodeError, Xstr:
- FileIn = codecs.open(File.Path, mode='rb', encoding='utf_16_le').read()
+ FileIn = codecs.open(File.Path, mode='rb', encoding='utf_16_le').readlines()
except:
EdkLogger.Error("Unicode File Parser",
ToolError.FILE_OPEN_FAILURE,
@@ -437,7 +437,7 @@ class UniFileClassObject(object):
# ExtraData='The file %s is either invalid UTF-16LE or it is missing the BOM.' % File.Path)
try:
- FileIn = codecs.open(File.Path, mode='rb', encoding='utf_8').read()
+ FileIn = codecs.open(File.Path, mode='rb', encoding='utf_8').readlines()
except UnicodeError, Xstr:
FileIn = codecs.open(File.Path, mode='rb', encoding='utf_16').readlines()
except UnicodeError:
@@ -579,9 +579,9 @@ class UniFileClassObject(object):
#
if Line.startswith(u'"'):
if StringEntryExistsFlag == 2:
- EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
+ EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
Message=ST.ERR_UNIPARSE_LINEFEED_UP_EXIST % Line, ExtraData=File.Path)
-
+
StringEntryExistsFlag = 1
if not Line.endswith('"'):
EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
@@ -589,7 +589,7 @@ class UniFileClassObject(object):
% (LineCount, File.Path))
elif Line.startswith(u'#language'):
if StringEntryExistsFlag == 2:
- EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
+ EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
Message=ST.ERR_UNI_MISS_STRING_ENTRY % Line, ExtraData=File.Path)
StringEntryExistsFlag = 0
else:
@@ -1050,7 +1050,7 @@ class UniFileClassObject(object):
ToolError.FILE_NOT_FOUND,
ExtraData=FilaPath)
try:
- FileIn = codecs.open(FilaPath, mode='rb', encoding='utf_8').read()
+ FileIn = codecs.open(FilaPath, mode='rb', encoding='utf_8').readlines()
except UnicodeError, Xstr:
FileIn = codecs.open(FilaPath, mode='rb', encoding='utf_16').readlines()
except UnicodeError: