Received: from eggs.gnu.org ([2001:4830:134:3::10]:36342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJh6i-0001ZG-07 for qemu-devel@nongnu.org; Tue, 19 Aug 2014 06:57:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJh6d-0000E4-7F for qemu-devel@nongnu.org; Tue, 19 Aug 2014 06:57:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJh6c-0000Dw-Vu for qemu-devel@nongnu.org; Tue, 19 Aug 2014 06:57:35 -0400 From: Markus Armbruster References: <1408399224-9834-1-git-send-email-maria.k@catit.be> <20140819094454.GD32354@T430.nay.redhat.com> Date: Tue, 19 Aug 2014 12:57:29 +0200 In-Reply-To: (M. Kustova's message of "Tue, 19 Aug 2014 13:55:16 +0400") Message-ID: <8761ho3fxi.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] image-fuzzer: Trivial readability and formatting improvements List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "M.Kustova" Cc: Kevin Wolf , Fam Zheng , qemu-devel@nongnu.org, Stefan Hajnoczi "M.Kustova" writes: > On Tue, Aug 19, 2014 at 1:44 PM, Fam Zheng wrote: >> On Tue, 08/19 02:00, Maria Kustova wrote: [...] >>> diff --git a/tests/image-fuzzer/runner.py b/tests/image-fuzzer/runner.py >>> index fd97c40..b142577 100755 >>> --- a/tests/image-fuzzer/runner.py >>> +++ b/tests/image-fuzzer/runner.py [...] >>> @@ -279,29 +277,30 @@ class TestEnv(object): >>> "Backing file: %s\n" \ >>> % (self.seed, " ".join(current_cmd), >>> self.current_dir, backing_file_name) >>> - >>> temp_log = StringIO.StringIO() >>> try: >>> retcode = run_app(temp_log, current_cmd) >>> except OSError, e: >>> - multilog(test_summary + "Error: Start of '%s' failed. " \ >>> - "Reason: %s\n\n" % (os.path.basename( >>> - current_cmd[0]), e[1]), >>> + multilog(test_summary + >>> + ("Error: Start of '%s' failed. Reason: %s\n\n" >>> + % (os.path.basename(current_cmd[0]), e[1])), >> >> I prefer the old one. I don't like the special case in python syntax: '(val)' >> is just val, but '(val1, val2)' is a tuple. > > This 'tuple' format provides that '%' substitution will be applied > only to the string in the parentheses, > instead of an entire string (in this case including test summary). > The same rationale for cases below. What about something like multilog("%sError: Start of '%s' failed. Reason: %s\n\n" % (test_summary, os.path.basename(current_cmd[0]), e[1]), sys.stderr, self.log, self.parent_log) [...]