From nobody Sun Feb 8 02:42:00 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1531477225538172.85469049069718; Fri, 13 Jul 2018 03:20:25 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 590692098847F; Fri, 13 Jul 2018 03:19:37 -0700 (PDT) Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (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 695DC20988474 for ; Fri, 13 Jul 2018 03:19:36 -0700 (PDT) Received: from localhost.localdomain (unknown.telstraglobal.net [134.159.103.118]) by smtp.nue.novell.com with ESMTP (NOT encrypted); Fri, 13 Jul 2018 12:19:33 +0200 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=195.135.221.5; helo=smtp.nue.novell.com; envelope-from=glin@suse.com; receiver=edk2-devel@lists.01.org From: Gary Lin To: edk2-devel@lists.01.org Date: Fri, 13 Jul 2018 18:18:46 +0800 Message-Id: <20180713101847.7485-16-glin@suse.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180713101847.7485-1-glin@suse.com> References: <20180713101847.7485-1-glin@suse.com> Subject: [edk2] [PATCH v2 15/16] BaseTools: Use absolute import in Workspace X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Based on "futurize -f libfuturize.fixes.fix_absolute_import Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/Source/Python/Workspace/DscBuildData.py | 9 +++++---- BaseTools/Source/Python/Workspace/InfBuildData.py | 3 ++- BaseTools/Source/Python/Workspace/MetaFileParser.py | 5 +++-- BaseTools/Source/Python/Workspace/MetaFileTable.py | 5 +++-- BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 3 ++- BaseTools/Source/Python/Workspace/WorkspaceDatabase.py | 7 ++++--- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 5cc814185eb9..65fc0882d8b4 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -18,6 +18,7 @@ # into PlatformBuildClassObject form for easier use for AutoGen. # from __future__ import print_function +from __future__ import absolute_import from Common.StringUtils import * from Common.DataType import * from Common.Misc import * @@ -26,11 +27,11 @@ from Common.Expression import * from CommonDataClass.CommonClass import SkuInfoClass from Common.TargetTxtClassObject import * from Common.ToolDefClassObject import * -from MetaDataTable import * -from MetaFileTable import * -from MetaFileParser import * +from .MetaDataTable import * +from .MetaFileTable import * +from .MetaFileParser import * =20 -from WorkspaceCommon import GetDeclaredPcd +from .WorkspaceCommon import GetDeclaredPcd from Common.Misc import AnalyzeDscPcd from Common.Misc import ProcessDuplicatedInf import re diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/= Source/Python/Workspace/InfBuildData.py index 165e03f78964..f79ffe28d804 100644 --- a/BaseTools/Source/Python/Workspace/InfBuildData.py +++ b/BaseTools/Source/Python/Workspace/InfBuildData.py @@ -12,11 +12,12 @@ # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. # =20 +from __future__ import absolute_import from Common.StringUtils import * from Common.DataType import * from Common.Misc import * from types import * -from MetaFileParser import * +from .MetaFileParser import * from collections import OrderedDict =20 from Workspace.BuildClassObject import ModuleBuildClassObject, LibraryClas= sObject, PcdClassObject diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTool= s/Source/Python/Workspace/MetaFileParser.py index 0aa72d8302a0..fbfc182c8bff 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -16,6 +16,7 @@ # Import Modules # from __future__ import print_function +from __future__ import absolute_import import Common.LongFilePathOs as os import re import time @@ -33,8 +34,8 @@ from Common.Expression import * from CommonDataClass.Exceptions import * from Common.LongFilePathSupport import OpenLongFilePath as open from collections import defaultdict -from MetaFileTable import MetaFileStorage -from MetaFileCommentParser import CheckInfComment +from .MetaFileTable import MetaFileStorage +from .MetaFileCommentParser import CheckInfComment =20 ## RegEx for finding file versions hexVersionPattern =3D re.compile(r'0[xX][\da-f-A-F]{5,8}') diff --git a/BaseTools/Source/Python/Workspace/MetaFileTable.py b/BaseTools= /Source/Python/Workspace/MetaFileTable.py index ee1c7fffca3b..e0a0b8d92351 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileTable.py +++ b/BaseTools/Source/Python/Workspace/MetaFileTable.py @@ -14,13 +14,14 @@ ## # Import Modules # +from __future__ import absolute_import import uuid =20 import Common.EdkLogger as EdkLogger from Common.BuildToolError import FORMAT_INVALID =20 -from MetaDataTable import Table, TableFile -from MetaDataTable import ConvertToSqlString +from .MetaDataTable import Table, TableFile +from .MetaDataTable import ConvertToSqlString from CommonDataClass.DataClass import MODEL_FILE_DSC, MODEL_FILE_DEC, MODE= L_FILE_INF, \ MODEL_FILE_OTHERS from Common.DataType import * diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseToo= ls/Source/Python/Workspace/WorkspaceCommon.py index e8f159b26204..d987bbf441ea 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py @@ -11,9 +11,10 @@ # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. # =20 +from __future__ import absolute_import from collections import OrderedDict, defaultdict from Common.DataType import SUP_MODULE_USER_DEFINED -from BuildClassObject import LibraryClassObject +from .BuildClassObject import LibraryClassObject import Common.GlobalData as GlobalData from Workspace.BuildClassObject import StructurePcd from Common.BuildToolError import RESOURCE_NOT_AVAILABLE diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py b/BaseT= ools/Source/Python/Workspace/WorkspaceDatabase.py index a40ab8fc8c88..e2f373745fc0 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py @@ -15,15 +15,16 @@ ## # Import Modules # +from __future__ import absolute_import import sqlite3 from Common.StringUtils import * from Common.DataType import * from Common.Misc import * from types import * =20 -from MetaDataTable import * -from MetaFileTable import * -from MetaFileParser import * +from .MetaDataTable import * +from .MetaFileTable import * +from .MetaFileParser import * =20 from Workspace.DecBuildData import DecBuildData from Workspace.DscBuildData import DscBuildData --=20 2.18.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel