From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=zhijux.fan@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E82C8211CCD73 for ; Thu, 21 Feb 2019 22:14:00 -0800 (PST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Feb 2019 22:13:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,398,1544515200"; d="dat'59?scan'59,208,59";a="140692030" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga001.jf.intel.com with ESMTP; 21 Feb 2019 22:13:59 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 21 Feb 2019 22:13:58 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 21 Feb 2019 22:13:58 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.162]) with mapi id 14.03.0415.000; Fri, 22 Feb 2019 14:13:56 +0800 From: "Fan, ZhijuX" To: "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Feng, Bob C" Thread-Topic: [edk2][PATCH] BaseTools:PackageDocumentTools import lib error occurs. Thread-Index: AdTKdap25Av4++juQquxS7YWMvjNtg== Date: Fri, 22 Feb 2019 06:13:56 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [PATCH] BaseTools:PackageDocumentTools import lib error occurs. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 06:14:01 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Steps: 1. Download edk2 tree 2. Build BaseTools 3. Go to edk2\BaseTools\Scripts\PackageDocumentTools to run packagedoc_cli.py An error occurs if relative imports are used when running a file alone Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan --- BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py | 4 ++-- .../plugins/EdkPlugins/edk2/model/baseobject.py | 10 +++++-= ---- .../PackageDocumentTools/plugins/EdkPlugins/edk2/model/dec.py | 4 ++-- .../plugins/EdkPlugins/edk2/model/doxygengen.py | 8 ++++--= -- .../plugins/EdkPlugins/edk2/model/doxygengen_spec.py | 8 ++++--= -- .../PackageDocumentTools/plugins/EdkPlugins/edk2/model/dsc.py | 4 ++-- .../PackageDocumentTools/plugins/EdkPlugins/edk2/model/inf.py | 4 ++-- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py b/Bas= eTools/Scripts/PackageDocumentTools/packagedoc_cli.py index e404a07cd7..5c65842a72 100644 --- a/BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py +++ b/BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py @@ -16,8 +16,8 @@ from __future__ import print_function import os, sys, logging, traceback, subprocess from optparse import OptionParser =20 -from .plugins.EdkPlugins.edk2.model import baseobject -from .plugins.EdkPlugins.edk2.model import doxygengen +from plugins.EdkPlugins.edk2.model import baseobject +from plugins.EdkPlugins.edk2.model import doxygengen =20 gArchMarcoDict =3D {'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', diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /model/baseobject.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPl= ugins/edk2/model/baseobject.py index 0159bd5269..de15efd3f8 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= baseobject.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= baseobject.py @@ -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 IMP= LIED. =20 -from ...basemodel import ini -from ...edk2.model import dsc -from ...edk2.model import inf -from ...edk2.model import dec +from plugins.EdkPlugins.basemodel import ini +from plugins.EdkPlugins.edk2.model import dsc +from plugins.EdkPlugins.edk2.model import inf +from plugins.EdkPlugins.edk2.model import dec import os -from ...basemodel.message import * +from plugins.EdkPlugins.basemodel.message import * =20 class SurfaceObject(object): _objs =3D {} diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /model/dec.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/e= dk2/model/dec.py index 3d210f72ac..568076547b 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= dec.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= dec.py @@ -11,9 +11,9 @@ # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. # =20 -from ...basemodel import ini +from plugins.EdkPlugins.basemodel import ini import re, os -from ...basemodel.message import * +from plugins.EdkPlugins.basemodel.message import * =20 class DECFile(ini.BaseINIFile): =20 diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /model/doxygengen.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPl= ugins/edk2/model/doxygengen.py index 9c299fbfc5..e31df262bc 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= doxygengen.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= doxygengen.py @@ -16,7 +16,7 @@ """This file produce action class to generate doxygen document for edk2 co= debase. The action classes are shared by GUI and command line tools. """ -from ...basemodel import doxygen +from plugins.EdkPlugins.basemodel import doxygen import os try: import wx @@ -24,9 +24,9 @@ try: except: gInGui =3D False import re -from ...edk2.model import inf -from ...edk2.model import dec -from ...basemodel.message import * +from plugins.EdkPlugins.edk2.model import inf +from plugins.EdkPlugins.edk2.model import dec +from plugins.EdkPlugins.basemodel.message import * =20 _ignore_dir =3D ['.svn', '_svn', 'cvs'] _inf_key_description_mapping_table =3D { diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /model/doxygengen_spec.py b/BaseTools/Scripts/PackageDocumentTools/plugins/= EdkPlugins/edk2/model/doxygengen_spec.py index 3a862a92ea..279b7fb8d4 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= doxygengen_spec.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= doxygengen_spec.py @@ -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 IMP= LIED. =20 -from ...basemodel import doxygen +from plugins.EdkPlugins.basemodel import doxygen import os try: import wx @@ -21,9 +21,9 @@ try: except: gInGui =3D False import re -from ...edk2.model import inf -from ...edk2.model import dec -from ...basemodel.message import * +from plugins.EdkPlugins.edk2.model import inf +from plugins.EdkPlugins.edk2.model import dec +from plugins.EdkPlugins.basemodel.message import * =20 _ignore_dir =3D ['.svn', '_svn', 'cvs'] _inf_key_description_mapping_table =3D { diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /model/dsc.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/e= dk2/model/dsc.py index 6f59e566b8..9c57f6f41f 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= dsc.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= dsc.py @@ -11,9 +11,9 @@ # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. # =20 -from ...basemodel import ini +from plugins.EdkPlugins.basemodel import ini import re, os -from ...basemodel.message import * +from plugins.EdkPlugins.basemodel.message import * =20 class DSCFile(ini.BaseINIFile): def GetSectionInstance(self, parent, name, isCombined=3DFalse): diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /model/inf.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/e= dk2/model/inf.py index cf2e49d3af..c5f03841d3 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= inf.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= inf.py @@ -11,9 +11,9 @@ # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. # =20 -from ...basemodel import ini +from plugins.EdkPlugins.basemodel import ini import re, os -from ...basemodel.message import * +from plugins.EdkPlugins.basemodel.message import * =20 class INFFile(ini.BaseINIFile): _libobjs =3D {} --=20 2.14.1.windows.1