From: "Fan, ZhijuX" <zhijux.fan@intel.com>
To: "Carsey, Jaben" <jaben.carsey@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>
Subject: FW: [PATCH] BaseTools:Function application error
Date: Fri, 15 Feb 2019 00:59:06 +0000 [thread overview]
Message-ID: <FAD0D7E0AE0FA54D987F6E72435CAFD50AF21C4E@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <CB6E33457884FA40993F35157061515CBCB7FCF1@FMSMSX103.amr.corp.intel.com>
The sdict() was originally defined as common/Misc.py and UPT/library/Misc.py.
However, the sdict() defined previously in common/Misc.py has been removed.
It is not as good as the OrderedDict() when running in Python3.
Any question, please let me know. Thanks.
Best Regards
Fan Zhiju
-----Original Message-----
From: Carsey, Jaben
Sent: Thursday, February 14, 2019 11:31 PM
To: Fan, ZhijuX <zhijux.fan@intel.com>; edk2-devel@lists.01.org
Cc: Gao, Liming <liming.gao@intel.com>
Subject: RE: [PATCH] BaseTools:Function application error
I am really confused by this patch and how it ever worked.
I see that you remove the import for sdict. But I see that sdict is used in other places in that file.
I also cant find a class definition for sdict anywhere (certainly not in Common/Misc).
So maybe refactor and remove all the other uses of sdict from the file?
-Jaben
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Fan, ZhijuX
> Sent: Thursday, February 14, 2019 1:12 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [PATCH] BaseTools:Function application error
>
> Error due to incorrect function parameters and attributes
> FileWrite() The first argument it needs is a list, not a file This
> patch abandons this function and saves the file independently
>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
> ---
> BaseTools/Source/Python/Eot/EotMain.py | 5 +++--
> BaseTools/Source/Python/Workspace/BuildClassObject.py | 1 +
> BaseTools/Source/Python/build/BuildReport.py | 9 ++++++---
> 3 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/BaseTools/Source/Python/Eot/EotMain.py
> b/BaseTools/Source/Python/Eot/EotMain.py
> index fd4bee6f90..8c2bfc45e4 100644
> --- a/BaseTools/Source/Python/Eot/EotMain.py
> +++ b/BaseTools/Source/Python/Eot/EotMain.py
> @@ -21,7 +21,7 @@ import Eot.EotGlobalData as EotGlobalData from
> optparse import OptionParser from Common.StringUtils import NormPath
> from Common import BuildToolError -from Common.Misc import
> GuidStructureStringToGuidString, sdict
> +from Common.Misc import GuidStructureStringToGuidString
> from Eot.Parser import *
> from Eot.InfParserLite import EdkInfParser from Common.StringUtils
> import GetSplitValueList @@ -32,6 +32,7 @@ from Eot.Report import
> Report from Common.BuildVersion import gBUILD_VERSION from
> Eot.Parser import ConvertGuid from Common.LongFilePathSupport import
> OpenLongFilePath as open
> +import collections
> import struct
> import uuid
> import copy
> @@ -57,7 +58,7 @@ class Image(array):
> self._LEN_ = None
> self._OFF_ = None
>
> - self._SubImages = sdict() # {offset: Image()}
> + self._SubImages = collections.OrderedDict() # {offset:
> + Image()}
>
> array.__init__(self)
>
> diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py
> b/BaseTools/Source/Python/Workspace/BuildClassObject.py
> index cff77a71ae..6f8a09e87c 100644
> --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py
> +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py
> @@ -261,6 +261,7 @@ class StructurePcd(PcdClassObject):
> self.PackageDecs = Packages
> self.DefaultStoreName = [default_store]
> self.DefaultValues = OrderedDict()
> + self.DefaultFromDSC = None
> self.PcdMode = None
> self.SkuOverrideValues = OrderedDict()
> self.StructName = None
> diff --git a/BaseTools/Source/Python/build/BuildReport.py
> b/BaseTools/Source/Python/build/BuildReport.py
> index 0b98d62cb6..70584570a5 100644
> --- a/BaseTools/Source/Python/build/BuildReport.py
> +++ b/BaseTools/Source/Python/build/BuildReport.py
> @@ -1651,14 +1651,17 @@ class PredictionReport(object):
> SourceList = os.path.join(self._EotDir, "SourceFile.txt")
> GuidList = os.path.join(self._EotDir, "GuidList.txt")
> DispatchList = os.path.join(self._EotDir, "Dispatch.txt")
> -
> + TempList = []
> TempFile = open(SourceList, "w+")
> for Item in self._SourceList:
> - FileWrite(TempFile, Item)
> + TempList.append(Item + TAB_LINE_BREAK)
> + TempFile.writelines(TempList)
> TempFile.close()
> + TempList = []
> TempFile = open(GuidList, "w+")
> for Key in self._GuidMap:
> - FileWrite(TempFile, "%s %s" % (Key, self._GuidMap[Key]))
> + TempList.append("%s %s %s" % (Key, self._GuidMap[Key],
> TAB_LINE_BREAK))
> + TempFile.writelines(TempList)
> TempFile.close()
>
> try:
> --
> 2.14.1.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
prev parent reply other threads:[~2019-02-15 0:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-14 9:11 [PATCH] BaseTools:Function application error Fan, ZhijuX
2019-02-14 15:30 ` Carsey, Jaben
2019-02-15 0:59 ` Fan, ZhijuX [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=FAD0D7E0AE0FA54D987F6E72435CAFD50AF21C4E@SHSMSX101.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox