summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/PatchPcdValue
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2015-12-18 06:43:57 +0000
committervanjeff <vanjeff@Edk2>2015-12-18 06:43:57 +0000
commit253a4b8ccbb4a984189eb29c48c25f6ef266ca80 (patch)
treea2207b2a3a2e6f9a42a5d9262cf616dfa369b727 /BaseTools/Source/Python/PatchPcdValue
parent818e60d95106bd68679bf4be1cef67f0d0af4b6c (diff)
downloadedk2-platforms-253a4b8ccbb4a984189eb29c48c25f6ef266ca80.tar.xz
BaseTools: Clean some coding style issues
This patch clean some coding style issues, majorly for space character. (Sync patch r19080 from main trunk.) 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/branches/UDK2015@19369 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/PatchPcdValue')
-rw-r--r--BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py b/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py
index 1b3a0ec93d..882da81930 100644
--- a/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py
+++ b/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py
@@ -48,7 +48,7 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize=0):
#
# Length of Binary File
#
- FileHandle = open (FileName, 'rb')
+ FileHandle = open(FileName, 'rb')
FileHandle.seek (0, 2)
FileLength = FileHandle.tell()
FileHandle.close()
@@ -75,7 +75,7 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize=0):
return OPTION_MISSING, "PcdMaxSize is not specified for VOID* type PCD."
ValueLength = int(MaxSize)
else:
- return PARAMETER_INVALID, "PCD type %s is not valid." %(CommandOptions.PcdTypeName)
+ return PARAMETER_INVALID, "PCD type %s is not valid." % (CommandOptions.PcdTypeName)
#
# Check PcdValue is in the input binary file.
#
@@ -84,7 +84,7 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize=0):
#
# Read binary file into array
#
- FileHandle = open (FileName, 'rb')
+ FileHandle = open(FileName, 'rb')
ByteArray = array.array('B')
ByteArray.fromfile(FileHandle, FileLength)
FileHandle.close()
@@ -117,7 +117,7 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize=0):
if ValueNumber != 0:
ValueNumber = 1
except:
- return PARAMETER_INVALID, "PCD Value %s is not valid dec or hex string." %(ValueString)
+ return PARAMETER_INVALID, "PCD Value %s is not valid dec or hex string." % (ValueString)
#
# Set PCD value into binary data
#
@@ -132,7 +132,7 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize=0):
else:
ValueNumber = int (ValueString)
except:
- return PARAMETER_INVALID, "PCD Value %s is not valid dec or hex string." %(ValueString)
+ return PARAMETER_INVALID, "PCD Value %s is not valid dec or hex string." % (ValueString)
#
# Set PCD value into binary data
#
@@ -174,7 +174,7 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize=0):
if Index >= ValueLength:
break
except:
- return PARAMETER_INVALID, "PCD Value %s is not valid dec or hex string array." %(ValueString)
+ return PARAMETER_INVALID, "PCD Value %s is not valid dec or hex string array." % (ValueString)
else:
#
# Patch ascii string
@@ -197,10 +197,10 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize=0):
if ByteList != OrigByteList:
ByteArray = array.array('B')
ByteArray.fromlist(ByteList)
- FileHandle = open (FileName, 'wb')
+ FileHandle = open(FileName, 'wb')
ByteArray.tofile(FileHandle)
FileHandle.close()
- return 0, "Patch Value into File %s successfully." %(FileName)
+ return 0, "Patch Value into File %s successfully." % (FileName)
## Parse command line options
#
@@ -270,7 +270,7 @@ def Main():
EdkLogger.error("PatchPcdValue", OPTION_MISSING, ExtraData="PcdOffset or PcdValue of PcdTypeName is not specified.")
return 1
if CommandOptions.PcdTypeName.upper() not in ["BOOLEAN", "UINT8", "UINT16", "UINT32", "UINT64", "VOID*"]:
- EdkLogger.error("PatchPcdValue", PARAMETER_INVALID, ExtraData="PCD type %s is not valid." %(CommandOptions.PcdTypeName))
+ EdkLogger.error("PatchPcdValue", PARAMETER_INVALID, ExtraData="PCD type %s is not valid." % (CommandOptions.PcdTypeName))
return 1
if CommandOptions.PcdTypeName.upper() == "VOID*" and CommandOptions.PcdMaxSize == None:
EdkLogger.error("PatchPcdValue", OPTION_MISSING, ExtraData="PcdMaxSize is not specified for VOID* type PCD.")