summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/UPT/Library/UniClassObject.py
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python/UPT/Library/UniClassObject.py')
-rw-r--r--BaseTools/Source/Python/UPT/Library/UniClassObject.py65
1 files changed, 0 insertions, 65 deletions
diff --git a/BaseTools/Source/Python/UPT/Library/UniClassObject.py b/BaseTools/Source/Python/UPT/Library/UniClassObject.py
index 80924a6f2a..1e7ca70a76 100644
--- a/BaseTools/Source/Python/UPT/Library/UniClassObject.py
+++ b/BaseTools/Source/Python/UPT/Library/UniClassObject.py
@@ -74,18 +74,6 @@ gLANG_CONV_TABLE = {'eng':'en', 'fra':'fr', \
'wln':'wa', 'wol':'wo', 'xho':'xh', 'yid':'yi', 'yor':'yo', 'zha':'za', \
'zho':'zh', 'zul':'zu'}
-## Convert a python unicode string to a normal string
-#
-# Convert a python unicode string to a normal string
-# UniToStr(u'I am a string') is 'I am a string'
-#
-# @param Uni: The python unicode string
-#
-# @retval: The formatted normal string
-#
-def UniToStr(Uni):
- return repr(Uni)[2:-1]
-
## Convert a unicode string to a Hex list
#
# Convert a unicode string to a Hex list
@@ -224,7 +212,6 @@ def FormatUniEntry(StrTokenName, TokenValueList, ContainerFile):
class StringDefClassObject(object):
def __init__(self, Name = None, Value = None, Referenced = False, Token = None, UseOtherLangDef = ''):
self.StringName = ''
- self.StringNameByteList = []
self.StringValue = ''
self.StringValueByteList = ''
self.Token = 0
@@ -234,7 +221,6 @@ class StringDefClassObject(object):
if Name is not None:
self.StringName = Name
- self.StringNameByteList = UniToHexList(Name)
if Value is not None:
self.StringValue = Value
self.StringValueByteList = UniToHexList(self.StringValue)
@@ -372,15 +358,6 @@ class UniFileClassObject(object):
self.AddStringToList(Name, Language, Value)
#
- # Get include file list and load them
- #
- def GetIncludeFile(self, Item, Dir = None):
- if Dir:
- pass
- FileName = Item[Item.find(u'!include ') + len(u'!include ') :Item.find(u' ', len(u'!include '))][1:-1]
- self.LoadUniFile(FileName)
-
- #
# Pre-process before parse .uni file
#
def PreProcess(self, File, IsIncludeFile=False):
@@ -942,26 +919,6 @@ class UniFileClassObject(object):
Item.Referenced = True
#
- # Search the string in language definition by Name
- #
- def FindStringValue(self, Name, Lang):
- if Name in self.OrderedStringDict[Lang]:
- ItemIndexInList = self.OrderedStringDict[Lang][Name]
- return self.OrderedStringList[Lang][ItemIndexInList]
-
- return None
-
- #
- # Search the string in language definition by Token
- #
- def FindByToken(self, Token, Lang):
- for Item in self.OrderedStringList[Lang]:
- if Item.Token == Token:
- return Item
-
- return None
-
- #
# Re-order strings and re-generate tokens
#
def ReToken(self):
@@ -1015,25 +972,3 @@ class UniFileClassObject(object):
print(Item)
for Member in self.OrderedStringList[Item]:
print(str(Member))
-
- #
- # Read content from '!include' UNI file
- #
- def ReadIncludeUNIfile(self, FilaPath):
- if self.File:
- pass
-
- if not os.path.exists(FilaPath) or not os.path.isfile(FilaPath):
- EdkLogger.Error("Unicode File Parser",
- ToolError.FILE_NOT_FOUND,
- ExtraData=FilaPath)
- try:
- FileIn = codecs.open(FilaPath, mode='rb', encoding='utf_8').readlines()
- except UnicodeError as Xstr:
- FileIn = codecs.open(FilaPath, mode='rb', encoding='utf_16').readlines()
- except UnicodeError:
- FileIn = codecs.open(FilaPath, mode='rb', encoding='utf_16_le').readlines()
- except:
- EdkLogger.Error("Unicode File Parser", ToolError.FILE_OPEN_FAILURE, ExtraData=FilaPath)
- return FileIn
-