Revert BaseTools: PYTHON3 migration

This reverts commit 6693f359b3c213513c5096a06c6f67244a44dc52..
678f851312.

Python3 migration is the fundamental change. It requires every developer
to install Python3. Before this migration, the well communication and wide
verification must be done. But now, most people is not aware of this change,
and not try it. So, Python3 migration is reverted and be moved to edk2-staging
Python3 branch for the edk2 user evaluation.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Liming Gao
2018-10-15 08:27:53 +08:00
parent 678f851312
commit 1ccc4d895d
182 changed files with 48049 additions and 15099 deletions

View File

@ -10,12 +10,12 @@
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
from ...basemodel import ini as ini
from ..model import dsc as dsc
from ..model import inf as inf
from ..model import dec as dec
import plugins.EdkPlugins.basemodel.ini as ini
import plugins.EdkPlugins.edk2.model.dsc as dsc
import plugins.EdkPlugins.edk2.model.inf as inf
import plugins.EdkPlugins.edk2.model.dec as dec
import os
from ...basemodel.message import *
from plugins.EdkPlugins.basemodel.message import *
class SurfaceObject(object):
_objs = {}
@ -25,7 +25,7 @@ class SurfaceObject(object):
@return: instance of this class
"""
obj = object.__new__(cls)
obj = object.__new__(cls, *args, **kwargs)
if "None" not in cls._objs:
cls._objs["None"] = []
cls._objs["None"].append(obj)
@ -846,7 +846,7 @@ class SurfaceItem(object):
ErrorMsg("%s item is duplicated defined in packages: %s and %s" %
(name, parent.GetFilename(), cls._objs[name].GetParent().GetFilename()))
return None
obj = object.__new__(cls)
obj = object.__new__(cls, *args, **kwargs)
cls._objs[name] = obj
return obj
elif issubclass(parent.__class__, Module):

View File

@ -11,9 +11,9 @@
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
from ...basemodel import ini
import plugins.EdkPlugins.basemodel.ini as ini
import re, os
from ...basemodel.message import *
from plugins.EdkPlugins.basemodel.message import *
class DECFile(ini.BaseINIFile):

View File

@ -16,7 +16,7 @@
"""This file produce action class to generate doxygen document for edk2 codebase.
The action classes are shared by GUI and command line tools.
"""
from ...basemodel import doxygen
import plugins.EdkPlugins.basemodel.doxygen as doxygen
import os
try:
import wx
@ -24,9 +24,9 @@ try:
except:
gInGui = False
import re
from ..model import inf
from ..model import dec
from ...basemodel.message import *
import plugins.EdkPlugins.edk2.model.inf as inf
import plugins.EdkPlugins.edk2.model.dec as dec
from plugins.EdkPlugins.basemodel.message import *
_ignore_dir = ['.svn', '_svn', 'cvs']
_inf_key_description_mapping_table = {
@ -386,7 +386,7 @@ class PackageDocumentAction(DoxygenAction):
configFile.AddFile(path)
no = 0
for no in range(len(lines)):
for no in xrange(len(lines)):
if len(lines[no].strip()) == 0:
continue
if lines[no].strip()[:2] in ['##', '//', '/*', '*/']:
@ -1000,7 +1000,7 @@ class PackageDocumentAction(DoxygenAction):
#file = textfile.TextFile(path)
try:
file = open(path, 'r')
file = open(path, 'rb')
except (IOError, OSError) as msg:
return None

View File

@ -13,7 +13,7 @@
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
from ...basemodel import doxygen
import plugins.EdkPlugins.basemodel.doxygen as doxygen
import os
try:
import wx
@ -21,9 +21,9 @@ try:
except:
gInGui = False
import re
from ..model import inf
from ..model import dec
from ...basemodel.message import *
import plugins.EdkPlugins.edk2.model.inf as inf
import plugins.EdkPlugins.edk2.model.dec as dec
from plugins.EdkPlugins.basemodel.message import *
_ignore_dir = ['.svn', '_svn', 'cvs']
_inf_key_description_mapping_table = {
@ -388,7 +388,7 @@ class PackageDocumentAction(DoxygenAction):
configFile.AddFile(path)
return
no = 0
for no in range(len(lines)):
for no in xrange(len(lines)):
if len(lines[no].strip()) == 0:
continue
if lines[no].strip()[:2] in ['##', '//', '/*', '*/']:
@ -1003,7 +1003,7 @@ class PackageDocumentAction(DoxygenAction):
#file = textfile.TextFile(path)
try:
file = open(path, 'r')
file = open(path, 'rb')
except (IOError, OSError) as msg:
return None

View File

@ -11,9 +11,9 @@
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
from ...basemodel import ini
import plugins.EdkPlugins.basemodel.ini as ini
import re, os
from ...basemodel.message import *
from plugins.EdkPlugins.basemodel.message import *
class DSCFile(ini.BaseINIFile):
def GetSectionInstance(self, parent, name, isCombined=False):

View File

@ -11,9 +11,9 @@
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
from ...basemodel import ini
import plugins.EdkPlugins.basemodel.ini as ini
import re, os
from ...basemodel.message import *
from plugins.EdkPlugins.basemodel.message import *
class INFFile(ini.BaseINIFile):
_libobjs = {}