From 47fea6afd74af76c7e2a2b03d319b7ac035ac26a Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Tue, 1 Dec 2015 04:22:16 +0000 Subject: BaseTools: Clean some coding style issues This patch clean some coding style issues, majorly for space character. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19080 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/Common/EdkIIWorkspace.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'BaseTools/Source/Python/Common/EdkIIWorkspace.py') diff --git a/BaseTools/Source/Python/Common/EdkIIWorkspace.py b/BaseTools/Source/Python/Common/EdkIIWorkspace.py index 401efeef3c..f22a545b77 100644 --- a/BaseTools/Source/Python/Common/EdkIIWorkspace.py +++ b/BaseTools/Source/Python/Common/EdkIIWorkspace.py @@ -59,7 +59,7 @@ class EdkIIWorkspace: # # Load TianoCoreOrgLogo, used for GUI tool # - self.Icon = wx.Icon(self.WorkspaceFile('tools/Python/TianoCoreOrgLogo.gif'),wx.BITMAP_TYPE_GIF) + self.Icon = wx.Icon(self.WorkspaceFile('tools/Python/TianoCoreOrgLogo.gif'), wx.BITMAP_TYPE_GIF) except: self.Icon = None @@ -151,7 +151,7 @@ class EdkIIWorkspace: def XmlParseFileSection (self, FileName, SectionTag): if self.Verbose: print FileName - return XmlParseFileSection (self.WorkspaceFile(FileName), SectionTag) + return XmlParseFileSection (self.WorkspaceFile(FileName), SectionTag) ## Save a XML file # @@ -219,19 +219,19 @@ class EdkIIWorkspace: # def ConvertTextFileToDictionary(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter): try: - F = open(FileName,'r') + F = open(FileName, 'r') except: return False Keys = [] for Line in F: - LineList = Line.split(KeySplitCharacter,1) + LineList = Line.split(KeySplitCharacter, 1) if len(LineList) >= 2: Key = LineList[0].split() - if len(Key) == 1 and Key[0][0] != CommentCharacter and Key[0] not in Keys: + if len(Key) == 1 and Key[0][0] != CommentCharacter and Key[0] not in Keys: if ValueSplitFlag: - Dictionary[Key[0]] = LineList[1].replace('\\','/').split(ValueSplitCharacter) + Dictionary[Key[0]] = LineList[1].replace('\\', '/').split(ValueSplitCharacter) else: - Dictionary[Key[0]] = LineList[1].strip().replace('\\','/') + Dictionary[Key[0]] = LineList[1].strip().replace('\\', '/') Keys += [Key[0]] F.close() return True @@ -252,7 +252,7 @@ def ConvertTextFileToDictionary(FileName, Dictionary, CommentCharacter, KeySplit # def ConvertDictionaryToTextFile(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter): try: - F = open(FileName,'r') + F = open(FileName, 'r') Lines = [] Lines = F.readlines() F.close() @@ -265,7 +265,7 @@ def ConvertDictionaryToTextFile(FileName, Dictionary, CommentCharacter, KeySplit MaxLength = len(Key) Index = 0 for Line in Lines: - LineList = Line.split(KeySplitCharacter,1) + LineList = Line.split(KeySplitCharacter, 1) if len(LineList) >= 2: Key = LineList[0].split() if len(Key) == 1 and Key[0][0] != CommentCharacter and Key[0] in Dictionary: @@ -275,17 +275,17 @@ def ConvertDictionaryToTextFile(FileName, Dictionary, CommentCharacter, KeySplit Line = '%-*s %c %s\n' % (MaxLength, Key[0], KeySplitCharacter, Dictionary[Key[0]]) Lines.pop(Index) if Key[0] in Keys: - Lines.insert(Index,Line) + Lines.insert(Index, Line) Keys.remove(Key[0]) Index += 1 for RemainingKey in Keys: if ValueSplitFlag: - Line = '%-*s %c %s\n' % (MaxLength, RemainingKey, KeySplitCharacter,' '.join(Dictionary[RemainingKey])) + Line = '%-*s %c %s\n' % (MaxLength, RemainingKey, KeySplitCharacter, ' '.join(Dictionary[RemainingKey])) else: Line = '%-*s %c %s\n' % (MaxLength, RemainingKey, KeySplitCharacter, Dictionary[RemainingKey]) Lines.append(Line) try: - F = open(FileName,'w') + F = open(FileName, 'w') except: return False F.writelines(Lines) -- cgit v1.2.3