From nobody Sat Jul 5 16:15:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1521528602634221.66819519694172; Mon, 19 Mar 2018 23:50:02 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 229C8C0587C0; Tue, 20 Mar 2018 06:50:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9936BA55; Tue, 20 Mar 2018 06:50:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B546F4CAAA; Tue, 20 Mar 2018 06:50:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nahO019428 for ; Tue, 20 Mar 2018 02:49:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8AC2060A9E; Tue, 20 Mar 2018 06:49:36 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 829406A03C for ; Tue, 20 Mar 2018 06:49:36 +0000 (UTC) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 92AEBC04AC4C for ; Tue, 20 Mar 2018 06:49:35 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id l9so1206498wmh.2 for ; Mon, 19 Mar 2018 23:49:35 -0700 (PDT) Received: from rst.Home ([2a02:c7d:692a:c500:1ebc:73f3:5f60:b131]) by smtp.gmail.com with ESMTPSA id g38sm1923269wra.77.2018.03.19.23.49.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xPAYKKnSr9Hed4fMSkBj9rB8arnU0mBa69xYb95akQU=; b=g1KpVASMAypF276bDDtstqZR+HkKHPVeS4JHa71dbaja8R3xQsY5ZXhDNeYTcD63FA s+btfJfQ/0CzmUwku4L0rIdN9EeauzyDQdOtZvO8OLVd8dK2McKFp6WD7fWakBPNv3eO +/30J+PeWYSntVG7Yn3KHgXBwbbHWcd/1mbdnTzP2P0wP+iiKRF2w1Dqxa419kPQSHZZ 1Os3vGmJs6rU0GgK3PKmdBG+nNpP+CdkUPlaBne5IcXSrcyHtxFy3pSYjbsrLptN+Wyu GYveAvdm230EDr4M95GHL2d2ep1wny+ONzukxU+IOGAEnLXptKqkeXucTmt4oNQgWUhD YYVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xPAYKKnSr9Hed4fMSkBj9rB8arnU0mBa69xYb95akQU=; b=Y6NHjoIKnaY++Dxubb8Sl1RsH4UZE7UtzcUcS6lV9zmFhtA2NGZCh/RYjJ1gg30haC /j9xN6nVF4mrKPH7iFpZHnbiAVrs0WdmIaZ8il0ZMW72sZ1t03QGjj+zZeZ6YdMSaaSH icFRDqiBvk7sA2GmXU0hGzmzfZF2794GftE9nzSHx/xbPbLikWLGOZBAtrHlyURZwfux N2T36BjMuk/P7Vk8plB4q27WhmsKxH4u/2EhY/WmhIs8bFSI1G1qwAq+PkYDuUsG8RAc 33qo634s0xoiGKvwa6bSwsQiJ00Z30CwliVl+Baf/lE3zCTv8ss+0xx48yC0humOdSnb ad+Q== X-Gm-Message-State: AElRT7EElY0RgSd6GYxopLYHNOuoCR1OL8CtafHF0576eDhXdBl9mpel G4MI0uGTvQldp7K2HGlo4yYWGvN2 X-Google-Smtp-Source: AG47ELvPTYvEJXy7xveUpD5QxufhEcCyAXcq2w0kLOwXnL7iW68NM5IpYAFNt+aky1WjvTostbvYEA== X-Received: by 10.28.72.7 with SMTP id v7mr1006223wma.155.1521528574022; Mon, 19 Mar 2018 23:49:34 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:51 +0000 Message-Id: <20180320064908.17723-9-rstoyanov1@gmail.com> In-Reply-To: <20180320064908.17723-1-rstoyanov1@gmail.com> References: <20180320064908.17723-1-rstoyanov1@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 20 Mar 2018 06:49:35 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 20 Mar 2018 06:49:35 +0000 (UTC) for IP:'74.125.82.67' DOMAIN:'mail-wm0-f67.google.com' HELO:'mail-wm0-f67.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.12 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 74.125.82.67 mail-wm0-f67.google.com 74.125.82.67 mail-wm0-f67.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 08/25] esx_vi_generator: Simplify alignment function X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 20 Mar 2018 06:50:01 +0000 (UTC) X-ZohoMail-DKIM: fail (Computed bodyhash is different from the expected one) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Generate whitespace using the standard function ljust() that is available in both Py3 [1] and Py2 [2]. 1: https://docs.python.org/3/library/stdtypes.html?highlight=3Dstrip#str.lj= ust 2: https://docs.python.org/2.7/library/string.html#string.ljust Signed-off-by: Radostin Stoyanov --- src/esx/esx_vi_generator.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py index df913d891..31bd10fb1 100755 --- a/src/esx/esx_vi_generator.py +++ b/src/esx/esx_vi_generator.py @@ -49,10 +49,7 @@ separator =3D "/* " + ("* " * 37) + "*\n" =20 =20 def aligned(left, right, length=3D59): - while len(left) < length: - left +=3D " " - - return left + right + return left.ljust(length, ' ') + right =20 =20 =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list