diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/Ecc b/BaseTools/Bin/CYGWIN_NT-5.1-i686/Ecc index 0b173eb33c..214d88fff1 100755 --- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/Ecc +++ b/BaseTools/Bin/CYGWIN_NT-5.1-i686/Ecc @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a $PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenDepex b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenDepex index 0b173eb33c..214d88fff1 100755 --- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenDepex +++ b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenDepex @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a $PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFds b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFds index 0b173eb33c..214d88fff1 100755 --- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFds +++ b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFds @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a $PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/TargetTool b/BaseTools/Bin/CYGWIN_NT-5.1-i686/TargetTool index 0b173eb33c..214d88fff1 100755 --- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/TargetTool +++ b/BaseTools/Bin/CYGWIN_NT-5.1-i686/TargetTool @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a $PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/Trim b/BaseTools/Bin/CYGWIN_NT-5.1-i686/Trim index 736ff12f14..7cac4f7c4f 100755 --- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/Trim +++ b/BaseTools/Bin/CYGWIN_NT-5.1-i686/Trim @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a $PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/build b/BaseTools/Bin/CYGWIN_NT-5.1-i686/build index 0b173eb33c..214d88fff1 100755 --- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/build +++ b/BaseTools/Bin/CYGWIN_NT-5.1-i686/build @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a $PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/BPDG b/BaseTools/BinWrappers/PosixLike/BPDG index 99dcf99657..276c7ea207 100755 --- a/BaseTools/BinWrappers/PosixLike/BPDG +++ b/BaseTools/BinWrappers/PosixLike/BPDG @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/Ecc b/BaseTools/BinWrappers/PosixLike/Ecc index 0032408fa1..1142964028 100755 --- a/BaseTools/BinWrappers/PosixLike/Ecc +++ b/BaseTools/BinWrappers/PosixLike/Ecc @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/GenDepex b/BaseTools/BinWrappers/PosixLike/GenDepex index f1bd62d7bd..dad174788b 100755 --- a/BaseTools/BinWrappers/PosixLike/GenDepex +++ b/BaseTools/BinWrappers/PosixLike/GenDepex @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/GenFds b/BaseTools/BinWrappers/PosixLike/GenFds index 99dcf99657..276c7ea207 100755 --- a/BaseTools/BinWrappers/PosixLike/GenFds +++ b/BaseTools/BinWrappers/PosixLike/GenFds @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable b/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable index 76effb6da0..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable +++ b/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/GenerateCapsule b/BaseTools/BinWrappers/PosixLike/GenerateCapsule index 3a1bd4d4e9..59a6c8ba43 100755 --- a/BaseTools/BinWrappers/PosixLike/GenerateCapsule +++ b/BaseTools/BinWrappers/PosixLike/GenerateCapsule @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/PatchPcdValue b/BaseTools/BinWrappers/PosixLike/PatchPcdValue index 76effb6da0..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/PatchPcdValue +++ b/BaseTools/BinWrappers/PosixLike/PatchPcdValue @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/Pkcs7Sign b/BaseTools/BinWrappers/PosixLike/Pkcs7Sign index 76effb6da0..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/Pkcs7Sign +++ b/BaseTools/BinWrappers/PosixLike/Pkcs7Sign @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys b/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys index 0d7872d24d..1bc1054a34 100755 --- a/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys +++ b/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign b/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign index 76effb6da0..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign +++ b/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/TargetTool b/BaseTools/BinWrappers/PosixLike/TargetTool index 76effb6da0..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/TargetTool +++ b/BaseTools/BinWrappers/PosixLike/TargetTool @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/Trim b/BaseTools/BinWrappers/PosixLike/Trim index f36bd69d26..6c8dde5bec 100755 --- a/BaseTools/BinWrappers/PosixLike/Trim +++ b/BaseTools/BinWrappers/PosixLike/Trim @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/UPT b/BaseTools/BinWrappers/PosixLike/UPT index 76effb6da0..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/UPT +++ b/BaseTools/BinWrappers/PosixLike/UPT @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/PosixLike/build b/BaseTools/BinWrappers/PosixLike/build index 76effb6da0..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/build +++ b/BaseTools/BinWrappers/PosixLike/build @@ -1,9 +1,9 @@ #!/usr/bin/env bash #python `dirname $0`/RunToolFromSource.py `basename $0` $* -# If a PYTHON3 command is available, use it in preference to python -if command -v $PYTHON3 >/dev/null 2>&1; then - python_exe=$PYTHON3 +# If a python2 command is available, use it in preference to python +if command -v python2 >/dev/null 2>&1; then + python_exe=python2 fi full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here diff --git a/BaseTools/BinWrappers/WindowsLike/BPDG.bat b/BaseTools/BinWrappers/WindowsLike/BPDG.bat index 8e2211e3c1..98095cfbd4 100644 --- a/BaseTools/BinWrappers/WindowsLike/BPDG.bat +++ b/BaseTools/BinWrappers/WindowsLike/BPDG.bat @@ -1,4 +1,4 @@ @setlocal @set ToolName=%~n0% @set PYTHONPATH=%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python -@%PYTHON3% -m %ToolName%.%ToolName% %* +@%PYTHON_HOME%\python.exe -m %ToolName%.%ToolName% %* diff --git a/BaseTools/BinWrappers/WindowsLike/Ecc.bat b/BaseTools/BinWrappers/WindowsLike/Ecc.bat index 151d9e730d..8705e7541e 100644 --- a/BaseTools/BinWrappers/WindowsLike/Ecc.bat +++ b/BaseTools/BinWrappers/WindowsLike/Ecc.bat @@ -1,4 +1,4 @@ @setlocal @set ToolName=%~n0% @set PYTHONPATH=%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python -@%PYTHON3% -m %ToolName%.EccMain %* +@%PYTHON_HOME%\python.exe -m %ToolName%.EccMain %* diff --git a/BaseTools/BinWrappers/WindowsLike/GenDepex.bat b/BaseTools/BinWrappers/WindowsLike/GenDepex.bat index e8e5753ce3..ffc783d2be 100644 --- a/BaseTools/BinWrappers/WindowsLike/GenDepex.bat +++ b/BaseTools/BinWrappers/WindowsLike/GenDepex.bat @@ -1,3 +1,3 @@ @setlocal @set ToolName=%~n0% -@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\AutoGen\%ToolName%.py %* +@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\AutoGen\%ToolName%.py %* diff --git a/BaseTools/BinWrappers/WindowsLike/GenFds.bat b/BaseTools/BinWrappers/WindowsLike/GenFds.bat index 8e2211e3c1..98095cfbd4 100644 --- a/BaseTools/BinWrappers/WindowsLike/GenFds.bat +++ b/BaseTools/BinWrappers/WindowsLike/GenFds.bat @@ -1,4 +1,4 @@ @setlocal @set ToolName=%~n0% @set PYTHONPATH=%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python -@%PYTHON3% -m %ToolName%.%ToolName% %* +@%PYTHON_HOME%\python.exe -m %ToolName%.%ToolName% %* diff --git a/BaseTools/BinWrappers/WindowsLike/GenPatchPcdTable.bat b/BaseTools/BinWrappers/WindowsLike/GenPatchPcdTable.bat index 160347c700..9fbb704a6e 100644 --- a/BaseTools/BinWrappers/WindowsLike/GenPatchPcdTable.bat +++ b/BaseTools/BinWrappers/WindowsLike/GenPatchPcdTable.bat @@ -1,3 +1,3 @@ @setlocal @set ToolName=%~n0% -@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* +@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* diff --git a/BaseTools/BinWrappers/WindowsLike/GenerateCapsule.bat b/BaseTools/BinWrappers/WindowsLike/GenerateCapsule.bat index a498b1efc5..ca442d181b 100644 --- a/BaseTools/BinWrappers/WindowsLike/GenerateCapsule.bat +++ b/BaseTools/BinWrappers/WindowsLike/GenerateCapsule.bat @@ -1 +1 @@ -@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\Capsule\GenerateCapsule.py %* +@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\Capsule\GenerateCapsule.py %* diff --git a/BaseTools/BinWrappers/WindowsLike/PatchPcdValue.bat b/BaseTools/BinWrappers/WindowsLike/PatchPcdValue.bat index 160347c700..9fbb704a6e 100644 --- a/BaseTools/BinWrappers/WindowsLike/PatchPcdValue.bat +++ b/BaseTools/BinWrappers/WindowsLike/PatchPcdValue.bat @@ -1,3 +1,3 @@ @setlocal @set ToolName=%~n0% -@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* +@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* diff --git a/BaseTools/BinWrappers/WindowsLike/Pkcs7Sign.bat b/BaseTools/BinWrappers/WindowsLike/Pkcs7Sign.bat index 160347c700..9fbb704a6e 100644 --- a/BaseTools/BinWrappers/WindowsLike/Pkcs7Sign.bat +++ b/BaseTools/BinWrappers/WindowsLike/Pkcs7Sign.bat @@ -1,3 +1,3 @@ @setlocal @set ToolName=%~n0% -@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* +@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* diff --git a/BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.bat b/BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.bat index c3323a742d..df9336567c 100644 --- a/BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.bat +++ b/BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256GenerateKeys.bat @@ -1 +1 @@ -@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\Rsa2048Sha256Sign\Rsa2048Sha256GenerateKeys.py %* +@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\Rsa2048Sha256Sign\Rsa2048Sha256GenerateKeys.py %* diff --git a/BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256Sign.bat b/BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256Sign.bat index 160347c700..9fbb704a6e 100644 --- a/BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256Sign.bat +++ b/BaseTools/BinWrappers/WindowsLike/Rsa2048Sha256Sign.bat @@ -1,3 +1,3 @@ @setlocal @set ToolName=%~n0% -@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* +@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* diff --git a/BaseTools/BinWrappers/WindowsLike/TargetTool.bat b/BaseTools/BinWrappers/WindowsLike/TargetTool.bat index 160347c700..9fbb704a6e 100644 --- a/BaseTools/BinWrappers/WindowsLike/TargetTool.bat +++ b/BaseTools/BinWrappers/WindowsLike/TargetTool.bat @@ -1,3 +1,3 @@ @setlocal @set ToolName=%~n0% -@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* +@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* diff --git a/BaseTools/BinWrappers/WindowsLike/Trim.bat b/BaseTools/BinWrappers/WindowsLike/Trim.bat index 160347c700..9fbb704a6e 100644 --- a/BaseTools/BinWrappers/WindowsLike/Trim.bat +++ b/BaseTools/BinWrappers/WindowsLike/Trim.bat @@ -1,3 +1,3 @@ @setlocal @set ToolName=%~n0% -@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* +@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* diff --git a/BaseTools/BinWrappers/WindowsLike/UPT.bat b/BaseTools/BinWrappers/WindowsLike/UPT.bat index 160347c700..9fbb704a6e 100644 --- a/BaseTools/BinWrappers/WindowsLike/UPT.bat +++ b/BaseTools/BinWrappers/WindowsLike/UPT.bat @@ -1,3 +1,3 @@ @setlocal @set ToolName=%~n0% -@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* +@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* diff --git a/BaseTools/BinWrappers/WindowsLike/build.bat b/BaseTools/BinWrappers/WindowsLike/build.bat index 160347c700..9fbb704a6e 100644 --- a/BaseTools/BinWrappers/WindowsLike/build.bat +++ b/BaseTools/BinWrappers/WindowsLike/build.bat @@ -1,3 +1,3 @@ @setlocal @set ToolName=%~n0% -@%PYTHON3% %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* +@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %* diff --git a/BaseTools/Makefile b/BaseTools/Makefile index 316f725bd9..b98cd85cb7 100644 --- a/BaseTools/Makefile +++ b/BaseTools/Makefile @@ -15,24 +15,24 @@ !ERROR "BASE_TOOLS_PATH is not set! Please run toolsetup.bat first!" !ENDIF -SUBDIRS = $(BASE_TOOLS_PATH)\Source\C +SUBDIRS = $(BASE_TOOLS_PATH)\Source\C $(BASE_TOOLS_PATH)\Source\Python -all: c +all: c python c : - @$(PYTHON3) $(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py all $(BASE_TOOLS_PATH)\Source\C + @$(PYTHON_HOME)\python.exe $(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py all $(BASE_TOOLS_PATH)\Source\C python: - @$(PYTHON3) $(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py all $(BASE_TOOLS_PATH)\Source\Python + @$(PYTHON_HOME)\python.exe $(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py all $(BASE_TOOLS_PATH)\Source\Python subdirs: $(SUBDIRS) - @$(PYTHON3) $(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py all $** + @$(PYTHON_HOME)\python.exe $(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py all $** .PHONY: clean clean: - $(PYTHON3) $(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py clean $(SUBDIRS) + $(PYTHON_HOME)\python.exe $(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py clean $(SUBDIRS) .PHONY: cleanall cleanall: - $(PYTHON3) $(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py cleanall $(SUBDIRS) + $(PYTHON_HOME)\python.exe $(BASE_TOOLS_PATH)\Source\C\Makefiles\NmakeSubdirs.py cleanall $(SUBDIRS) diff --git a/BaseTools/Scripts/PackageDocumentTools/Readme.md b/BaseTools/Scripts/PackageDocumentTools/Readme.md index f8f81e35ab..dfc2892c41 100644 --- a/BaseTools/Scripts/PackageDocumentTools/Readme.md +++ b/BaseTools/Scripts/PackageDocumentTools/Readme.md @@ -1,6 +1,6 @@ Prerequisite Tools: -1. Install Python 3.6.6 from https://www.python.org/downloads/release/python-366/ -2. Install wxPython 4.0.3 from https://pypi.org/project/wxPython/#files +1. Install Python 2.7.3 from https://www.python.org/download/releases/2.7.3/ +2. Install wxPython 2.8.12.1 from https://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/ generally the libraries will be installed at python's subfolder, for example in windows: c:\python27\Lib\site-packages\ 3. Install DoxyGen 1.8.6 from https://sourceforge.net/projects/doxygen/files/rel-1.8.6/ 4. (Windows only) Install Htmlhelp tool from https://msdn.microsoft.com/en-us/library/windows/desktop/ms669985(v=vs.85).aspx diff --git a/BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py b/BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py index 94c004902f..4deeee01a5 100644 --- a/BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py +++ b/BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py @@ -12,11 +12,12 @@ # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # +from __future__ import print_function import os, sys, logging, traceback, subprocess from optparse import OptionParser -from .plugins.EdkPlugins.edk2.model import baseobject -from .plugins.EdkPlugins.edk2.model import doxygengen +import plugins.EdkPlugins.edk2.model.baseobject as baseobject +import plugins.EdkPlugins.edk2.model.doxygengen as doxygengen gArchMarcoDict = {'ALL' : 'MDE_CPU_IA32 MDE_CPU_X64 MDE_CPU_EBC MDE_CPU_IPF _MSC_EXTENSIONS __GNUC__ __INTEL_COMPILER', 'IA32_MSFT': 'MDE_CPU_IA32 _MSC_EXTENSIONS', @@ -37,7 +38,7 @@ def parseCmdArgs(): help='Specify the absolute path of doxygen tools installation. For example: C:\\Program Files\\doxygen\bin\doxygen.exe') parser.add_option('-o', '--output', action='store', dest='OutputPath', help='Specify the document output path. For example: c:\\docoutput') - parser.add_option('-a', '--arch', action='store', dest='Arch', choices=list(gArchMarcoDict.keys()), + parser.add_option('-a', '--arch', action='store', dest='Arch', choices=gArchMarcoDict.keys(), help='Specify the architecture used in preprocess package\'s source. For example: -a IA32_MSFT') parser.add_option('-m', '--mode', action='store', dest='DocumentMode', choices=['CHM', 'HTML'], help='Specify the document mode from : CHM or HTML') diff --git a/BaseTools/Scripts/PackageDocumentTools/packagedocapp.pyw b/BaseTools/Scripts/PackageDocumentTools/packagedocapp.pyw index f81ecfdc4c..28f6f9bf5c 100644 --- a/BaseTools/Scripts/PackageDocumentTools/packagedocapp.pyw +++ b/BaseTools/Scripts/PackageDocumentTools/packagedocapp.pyw @@ -18,8 +18,8 @@ import os, sys, wx, logging import wx.stc import wx.lib.newevent import wx.lib.agw.genericmessagedialog as GMD -from plugins.EdkPlugins.edk2.model import baseobject -from plugins.EdkPlugins.edk2.model import doxygengen +import plugins.EdkPlugins.edk2.model.baseobject as baseobject +import plugins.EdkPlugins.edk2.model.doxygengen as doxygengen if hasattr(sys, "frozen"): appPath = os.path.abspath(os.path.dirname(sys.executable)) @@ -42,7 +42,7 @@ class PackageDocApp(wx.App): frame.Show(True) - self.Bind(EVT_APP_CALLBACK, self.OnAppCallBack) + EVT_APP_CALLBACK( self, self.OnAppCallBack) return True def GetLogger(self): @@ -60,13 +60,13 @@ class PackageDocApp(wx.App): class PackageDocMainFrame(wx.Frame): def __init__(self, parent, title): - wx.Frame.__init__(self, parent, -1, title, size=(550, 350), style=wx.MINIMIZE_BOX|wx.SYSTEM_MENU|wx.CAPTION|wx.CLOSE_BOX ) + wx.Frame.__init__(self, parent, -1, title, size=(550, 290), style=wx.MINIMIZE_BOX|wx.SYSTEM_MENU|wx.CAPTION|wx.CLOSE_BOX ) panel = wx.Panel(self) sizer = wx.BoxSizer(wx.VERTICAL) subsizer = wx.GridBagSizer(5, 10) - subsizer.AddGrowableCol(0) + subsizer.AddGrowableCol(1) subsizer.Add(wx.StaticText(panel, -1, "Workspace Location : "), (0, 0), flag=wx.ALIGN_CENTER_VERTICAL) self._workspacePathCtrl = wx.ComboBox(panel, -1) list = self.GetConfigure("WorkspacePath") @@ -76,9 +76,9 @@ class PackageDocMainFrame(wx.Frame): self._workspacePathCtrl.SetValue(list[len(list) - 1]) subsizer.Add(self._workspacePathCtrl, (0, 1), flag=wx.ALIGN_CENTER_VERTICAL|wx.EXPAND) - self._workspacePathBt = wx.BitmapButton(panel, -1, bitmap=wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN)) + self._workspacePathBt = wx.BitmapButton(panel, -1, bitmap=wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) subsizer.Add(self._workspacePathBt, (0, 2), flag=wx.ALIGN_CENTER_VERTICAL) - self.Bind(wx.EVT_BUTTON, self.OnBrowsePath, self._workspacePathBt) + wx.EVT_BUTTON(self._workspacePathBt, self._workspacePathBt.GetId(), self.OnBrowsePath) subsizer.Add(wx.StaticText(panel, -1, "Package DEC Location : "), (1, 0), flag=wx.ALIGN_CENTER_VERTICAL|wx.EXPAND) self._packagePathCtrl = wx.ComboBox(panel, -1) @@ -88,9 +88,9 @@ class PackageDocMainFrame(wx.Frame): self._packagePathCtrl.Append(item) self._packagePathCtrl.SetValue(list[len(list) - 1]) subsizer.Add(self._packagePathCtrl, (1, 1), flag=wx.ALIGN_CENTER_VERTICAL|wx.EXPAND) - self._packagePathBt = wx.BitmapButton(panel, -1, bitmap=wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN)) + self._packagePathBt = wx.BitmapButton(panel, -1, bitmap=wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) subsizer.Add(self._packagePathBt, (1, 2), flag=wx.ALIGN_CENTER_VERTICAL) - self.Bind(wx.EVT_BUTTON, self.OnBrowsePath, self._packagePathBt) + wx.EVT_BUTTON(self._packagePathBt, self._packagePathBt.GetId(), self.OnBrowsePath) subsizer.Add(wx.StaticText(panel, -1, "Doxygen Tool Location : "), (2, 0), flag=wx.ALIGN_CENTER_VERTICAL) self._doxygenPathCtrl = wx.TextCtrl(panel, -1) @@ -103,10 +103,10 @@ class PackageDocMainFrame(wx.Frame): else: self._doxygenPathCtrl.SetValue('/usr/bin/doxygen') - self._doxygenPathBt = wx.BitmapButton(panel, -1, bitmap=wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN)) + self._doxygenPathBt = wx.BitmapButton(panel, -1, bitmap=wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) subsizer.Add(self._doxygenPathCtrl, (2, 1), flag=wx.ALIGN_CENTER_VERTICAL|wx.EXPAND) subsizer.Add(self._doxygenPathBt, (2, 2), flag=wx.ALIGN_CENTER_VERTICAL) - self.Bind(wx.EVT_BUTTON, self.OnBrowsePath, self._doxygenPathBt) + wx.EVT_BUTTON(self._doxygenPathBt, self._doxygenPathBt.GetId(), self.OnBrowsePath) subsizer.Add(wx.StaticText(panel, -1, "CHM Tool Location : "), (3, 0), flag=wx.ALIGN_CENTER_VERTICAL) self._chmPathCtrl = wx.TextCtrl(panel, -1) @@ -116,10 +116,10 @@ class PackageDocMainFrame(wx.Frame): else: self._chmPathCtrl.SetValue('C:\\Program Files\\HTML Help Workshop\\hhc.exe') - self._chmPathBt = wx.BitmapButton(panel, -1, bitmap=wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN)) + self._chmPathBt = wx.BitmapButton(panel, -1, bitmap=wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) subsizer.Add(self._chmPathCtrl, (3, 1), flag=wx.ALIGN_CENTER_VERTICAL|wx.EXPAND) subsizer.Add(self._chmPathBt, (3, 2), flag=wx.ALIGN_CENTER_VERTICAL) - self.Bind(wx.EVT_BUTTON, self.OnBrowsePath, self._chmPathBt) + wx.EVT_BUTTON(self._chmPathBt, self._chmPathBt.GetId(), self.OnBrowsePath) subsizer.Add(wx.StaticText(panel, -1, "Output Location : "), (4, 0), flag=wx.ALIGN_CENTER_VERTICAL) self._outputPathCtrl = wx.ComboBox(panel, -1) @@ -130,9 +130,9 @@ class PackageDocMainFrame(wx.Frame): self._outputPathCtrl.SetValue(list[len(list) - 1]) subsizer.Add(self._outputPathCtrl, (4, 1), flag=wx.ALIGN_CENTER_VERTICAL|wx.EXPAND) - self._outputPathBt = wx.BitmapButton(panel, -1, bitmap=wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN)) + self._outputPathBt = wx.BitmapButton(panel, -1, bitmap=wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) subsizer.Add(self._outputPathBt, (4, 2), flag=wx.ALIGN_CENTER_VERTICAL|wx.EXPAND) - self.Bind(wx.EVT_BUTTON, self.OnBrowsePath, self._outputPathBt) + wx.EVT_BUTTON(self._outputPathBt, self._outputPathBt.GetId(), self.OnBrowsePath) subsizer.Add(wx.StaticText(panel, -1, "Architecture Specified : "), (5, 0), flag=wx.ALIGN_CENTER_VERTICAL) self._archCtrl = wx.ComboBox(panel, -1, value='ALL', choices=['ALL', 'IA32/MSFT', 'IA32/GNU', 'X64/INTEL', 'X64/GNU', 'IPF/MSFT', 'IPF/GNU', 'EBC/INTEL'], @@ -164,7 +164,7 @@ class PackageDocMainFrame(wx.Frame): def SaveConfigure(self, name, value): if value ==None or len(value) == 0: return - config = wx.ConfigBase.Get() + config = wx.ConfigBase_Get() oldvalues = config.Read(name, '').split(';') if len(oldvalues) >= 10: oldvalues.remove(oldvalues[0]) @@ -177,7 +177,7 @@ class PackageDocMainFrame(wx.Frame): config.Write(name, ';'.join(oldvalues)) def GetConfigure(self, name): - config = wx.ConfigBase.Get() + config = wx.ConfigBase_Get() values = config.Read(name, '').split(';') list = [] for item in values: @@ -416,10 +416,10 @@ class ProgressDialog(wx.Dialog): logging.getLogger('').addHandler(self._loghandle) logging.getLogger('app').addHandler(self._loghandle) - self.Bind(wx.EVT_BUTTON, self.OnButtonClose, self._closeBt) - self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateCloseButton) - self.Bind(wx.EVT_BUTTON, self.OnGotoOutput, self._gotoOuputBt) - self.Bind(EVT_LOG, self.OnPostLog) + wx.EVT_BUTTON(self._closeBt, self._closeBt.GetId(), self.OnButtonClose) + wx.EVT_UPDATE_UI(self, self._closeBt.GetId(), self.OnUpdateCloseButton) + wx.EVT_BUTTON(self._gotoOuputBt, self._gotoOuputBt.GetId(), self.OnGotoOutput) + EVT_LOG(self, self.OnPostLog) self._process = None self._pid = None @@ -720,7 +720,7 @@ class ProgressDialog(wx.Dialog): lines = f.readlines() f.close() bfound = False - for index in range(len(lines)): + for index in xrange(len(lines)): if lines[index].find('File List') != -1: lines[index] = "