From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=S1; bh=ZuxnvlS3jYkUTRznGeRyq8NF3L2rOX6KGKyLY8+PODA=; b=QY9lMEYPtYNB69osqhSx81Y+AbCbptkyB2GTnJCUbTPyrR0JP4OaHJKMUk40wz904giU QsH0UvYa4OWGBekRRQCSKar2FLuTdEV00eQsktasxGbXpzLg+HkxYXCnO6DEfAtS55uY iJ5zbRJT6VYTmG1qWgyeBfhbPOuM/Iy7aO8D4ePLj9VmVkYGvPy5kXWzksNjVO0puuCA sXDczRDCRB6TEXzCCznlPkkr6gyfViE5onvciFwfewdbOBzBgZT49B79N48B2mr6cbnx L7luADKtKitLK3Lb1SqhUb08bPNkd3k+NHoh/QqgKkW3QaP3WISzWhb8yWhPzPFIMmCm YA== From: "Bird, Tim" Date: Fri, 13 May 2022 17:56:11 +0000 Message-ID: References: <20220420101140.27182-1-sireesha.nakkala@toshiba-tsip.com> <20220420101140.27182-4-sireesha.nakkala@toshiba-tsip.com> In-Reply-To: <20220420101140.27182-4-sireesha.nakkala@toshiba-tsip.com> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [Fuego] [PATCH 3/8] Use file descriptor instead of file.write() List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "sireesha.nakkala@toshiba-tsip.com" Cc: "kazuhiro3.hayashi@toshiba.co.jp" , "dinesh.kumar@toshiba-tsip.com" , Shivanand Kunijadar , "fuego@lists.linuxfoundation.org" > -----Original Message----- > From: sireesha.nakkala@toshiba-tsip.com >=20 > From: Shivanand Kunijadar >=20 > Use of file descriptor to write a file is compatible with python2 and > python3. >=20 > Signed-off-by: Shivanand Kunijadar > --- > scripts/ovgen.py | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/scripts/ovgen.py b/scripts/ovgen.py > index faabc62..a6e0f13 100755 > --- a/scripts/ovgen.py > +++ b/scripts/ovgen.py > @@ -375,27 +375,27 @@ def generateProlog(logdir, ofcls, classes, testdir,= testspec): > name =3D ofc.name > debug_print ("\nwriting %s base class" % (name)) >=20 > - file.write(outfile, "#class: %s\n" % (name)) > + outfile.write("#class: %s\n" % (name)) >=20 > for var in ofc.vars: > outStr =3D "%s=3D\"%s\"" % (var, ofc.vars[var]) > outStr =3D outStr.replace('"', '\"') > debug_print("%s <- %s" % (outFilePath, outStr)) > - file.write(outfile, outStr+"\n") > + outfile.write(outStr+"\n") >=20 > for cap in ofc.cap_list: > outStr =3D "CAP_%s=3D\"yes\"" % (cap) > debug_print("%s <- %s" % (outFilePath, outStr)) > - file.write(outfile, outStr+"\n") > + outfile.write(outStr+"\n") >=20 > - file.write(outfile, "\n") > + outfile.write("\n") >=20 > for func in ofc.funcs: > body =3D ofc.funcs[func] > debug_print("%s <- %s()" % (outFilePath, func)) > - file.write(outfile, body+"\n") > + outfile.write(body+"\n") >=20 > - file.write(outfile, "\n") > + outfile.write("\n") >=20 > ts =3D parseSpec(logdir, testdir, testspec) > generateSpec(ts, outfile) > -- > 2.20.1 >=20 Looks good. Tested (with python2) and applied. Thanks. -- Tim