diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2015-12-01 04:22:16 +0000 |
---|---|---|
committer | yzhu52 <yzhu52@Edk2> | 2015-12-01 04:22:16 +0000 |
commit | 47fea6afd74af76c7e2a2b03d319b7ac035ac26a (patch) | |
tree | 348d137b6d5f3f8c4e654ace654d3893f3408f68 /BaseTools/Source/Python/Common/EdkIIWorkspace.py | |
parent | 9913dce8aeb8c154ccea23be0835b2c50a8613b4 (diff) | |
download | edk2-platforms-47fea6afd74af76c7e2a2b03d319b7ac035ac26a.tar.xz |
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 <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19080 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Common/EdkIIWorkspace.py')
-rw-r--r-- | BaseTools/Source/Python/Common/EdkIIWorkspace.py | 24 |
1 files changed, 12 insertions, 12 deletions
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)
|