From nobody Tue Apr 30 02:56:49 2024 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 1521528599563376.73507448603175; Mon, 19 Mar 2018 23:49:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4399880461; Tue, 20 Mar 2018 06:49:58 +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 0D9D6C5DA7; Tue, 20 Mar 2018 06:49:58 +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 C2EB14CAA2; Tue, 20 Mar 2018 06:49:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nTS9019367 for ; Tue, 20 Mar 2018 02:49:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id B14D05D724; Tue, 20 Mar 2018 06:49:29 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A8D995DA62 for ; Tue, 20 Mar 2018 06:49:26 +0000 (UTC) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) (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 7F1AE883B4 for ; Tue, 20 Mar 2018 06:49:25 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id c24so462455wrc.6 for ; Mon, 19 Mar 2018 23:49:25 -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.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:22 -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=+qhSd8+FLJbcsdWvKcd/oyNGyhTmPcQQpTESqCj05Fs=; b=kbhtd4rKMZrcqkdqngis48gOsPomYaczcPFDtBRHj1E3KZdkL3aaj2cVzuq6LUIKW8 yPni/KvMObe4sH+GC+x0aE1FHzuHGsWoobRt02/y4o/JaAzJiQZJ+KfIzzwIgtuXQjgm qYAOdC98+i76+cOSYjNPZ+IJv9q6Us0pvi3YYXQ4lAMPkCbn090QePyE7gVu8uflm6oD J7KP1lc40c0mlIFnGmWQsvFy/s8lv5LhWIk0oyCONl+7cNaPNYCqm2ezhrWWjTxIiRCR fgEnUyCTbFJ+CPul8WAoCKgZK63BASGM/XUwwtqxPqubiHHXhPuUhhCtKSsI5/g6olia ijbA== 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=+qhSd8+FLJbcsdWvKcd/oyNGyhTmPcQQpTESqCj05Fs=; b=Wc2JVCcxR3q6//YcVLmTWj60Y/wnoVC/4NYgz+9ISB63plhUnuwzemiLM1tB4CKV8Z NfFfoYP2X18MqIi8KvFd3P7tjkmSHrum6rXjfflTMjA9wFz7mjfc7MhYFVEHF0kMTF6e ZTx6JiqQJyD+A8U3romHovePHE/4AUv6czW7A22cwIzLDhEs6C+fILWv7Kp/v2Pp4NB/ BTZ4sEfVe1PSSxWriOyEq0dUxKefdGUZlaw9c/OEQ/yLjqmY+9RGanXADPzCd9gwnVfO H0Qib7l7VKuIor1lwg7x6vtnvWYCxhcPcu9acAwhDlnvbtWx1nIJ37W3EAmIEbSEoBof IImA== X-Gm-Message-State: AElRT7GIBpJ3mFtioEhrSzNxuKbPQiees8FUz1bDajq/0S/ycyA7FmSm yQ8CQAE1eyBdizz4XYxZPJDp1K7I X-Google-Smtp-Source: AG47ELtGRZ9Sucb9FrmVEWIE+7cUD8ZsrFi1nE/uflfPYMp2ybQfxmsbqTjXN8iZZ77ytEKfxfhsbg== X-Received: by 10.223.185.73 with SMTP id b9mr11750793wrg.229.1521528563868; Mon, 19 Mar 2018 23:49:23 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:44 +0000 Message-Id: <20180320064908.17723-2-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.26]); Tue, 20 Mar 2018 06:49:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 20 Mar 2018 06:49:25 +0000 (UTC) for IP:'209.85.128.196' DOMAIN:'mail-wr0-f196.google.com' HELO:'mail-wr0-f196.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.196 mail-wr0-f196.google.com 209.85.128.196 mail-wr0-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 01/25] apibuild: Use isinstance for type checking 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 20 Mar 2018 06:49:58 +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" The isinstance() function [1] returns true if an object argument is an instance of a classinfo argument or of a direct, indirect subclass thereof. 1: https://docs.python.org/3/library/functions.html#isinstance Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 17d14a0c5..832f04ab1 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -742,7 +742,7 @@ class CParser: return line =20 def cleanupComment(self): - if type(self.comment) !=3D type(""): + if not isinstance(self.comment, str): return # remove the leading * on multi-line comments lines =3D self.comment.splitlines(True) @@ -2223,9 +2223,8 @@ class docBuilder: output.write(" \n") try: for field in self.idx.structs[name].info: --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528580041344.4196914603207; Mon, 19 Mar 2018 23:49:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36A34C04BD38; Tue, 20 Mar 2018 06:49:38 +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 9B9672CFB8; Tue, 20 Mar 2018 06:49:37 +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 5BC2C4CA9A; Tue, 20 Mar 2018 06:49:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nTul019366 for ; Tue, 20 Mar 2018 02:49:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id AE3205D721; Tue, 20 Mar 2018 06:49:29 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A68595D962 for ; Tue, 20 Mar 2018 06:49:28 +0000 (UTC) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) (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 D17D919D39C for ; Tue, 20 Mar 2018 06:49:26 +0000 (UTC) Received: by mail-wm0-f52.google.com with SMTP id i189so270279wmf.0 for ; Mon, 19 Mar 2018 23:49:26 -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.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:24 -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=ouyzYZcbc46pGs9I1dSnv9k6/AOJ7pttx+xjIEiky1c=; b=a6fJX8g50NuepyU/Qu8eFr114KfKZ0caAPNYsT0dGt/4K9nvcEYSP9Um9+onfhLmRo H4mKAqKwh2r0fvGg2K3hc5+DyzCsKWN8Sd+AzR9AqGmeLppSFLs9ZkRVS+ZPGlG93bTf G6iXsg5ZfA5y8+BWoc1BZAdgLhCBNk+LsM6rI3V0pcaZQLxUVWP8nf9guaDGm0RkrDof fHems2XfxlJjT4RREWumQyaAj915+ZEvkA24c3pgFXeFvFbin/6iUWPl7ioTnfIBwaq+ 86jzBViwjOkGSoonmXtE6jBhoKavzshV28TYv9VUdxMtsUr8xYh9R7q0Sf/WzJE+QkDq QK+g== 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=ouyzYZcbc46pGs9I1dSnv9k6/AOJ7pttx+xjIEiky1c=; b=BdALJlzSf9SJn0B8LkMabpc1Z+6Z8dLwktCjOl6eIBxxwohNJkTR7tIeX1l0G8B8/F DxozOKCnSxw7lmDG9isSqpZTRGZ36upOM/f1E0D7+hTQEEey9b2bCpxh30ngIlvQcB/R 77WrOdua2JZZd9ej/fbLeYIZPq/ndERmwHhIL+heef/qUDdqE58Gb+uVJoJUjYMEut5u kfEaOzFoXCOGHZeEHiWDJtld7H5mClaBOPEDXgeFXR0DdROrB/3sfeuL5PsPg7a9VnLx KKsgh9ERevY5exoxUiATtGp7jY5w+OD6tipQKCHQlkn7KvkdmC/KQ8ybeRUmE5C19AAU 83zg== X-Gm-Message-State: AElRT7Gdy/r9J0G7IaZr2OXm/kyj/M8fTdnby54e/CEIFpsRNVPe0LmQ cmMg+CBQs9McIE10Jl9AQEmAK+xs X-Google-Smtp-Source: AG47ELvRlXqxqM1w9660FzyPpR+2qEE4rMU5u6cGJHANISPbRhmzuVcunqd1g9fwlQpjSKtSKFu8rQ== X-Received: by 10.28.228.9 with SMTP id b9mr1116466wmh.131.1521528565284; Mon, 19 Mar 2018 23:49:25 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:45 +0000 Message-Id: <20180320064908.17723-3-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.29]); Tue, 20 Mar 2018 06:49:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 20 Mar 2018 06:49:27 +0000 (UTC) for IP:'74.125.82.52' DOMAIN:'mail-wm0-f52.google.com' HELO:'mail-wm0-f52.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.52 mail-wm0-f52.google.com 74.125.82.52 mail-wm0-f52.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 02/25] apibuild: Split imports on separate lines 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.13 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:38 +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" PEP8 recommends imports to be on separate lines. [1] 1: https://www.python.org/dev/peps/pep-0008/#imports Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 832f04ab1..7507c1d26 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -10,7 +10,8 @@ =20 from __future__ import print_function =20 -import os, sys +import os +import sys import glob import re =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528604070568.6916534431282; Mon, 19 Mar 2018 23:50:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7DD7D81DF3; Tue, 20 Mar 2018 06:50:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B83E18999; Tue, 20 Mar 2018 06:50:02 +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 D4795181B9FF; Tue, 20 Mar 2018 06:50:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nVRo019383 for ; Tue, 20 Mar 2018 02:49:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id E83E64143; Tue, 20 Mar 2018 06:49:31 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF9BB60BE7 for ; Tue, 20 Mar 2018 06:49:31 +0000 (UTC) Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) (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 17A0D3B594 for ; Tue, 20 Mar 2018 06:49:29 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id z8so458944wrh.7 for ; Mon, 19 Mar 2018 23:49:29 -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.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:26 -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=rMhauTbDpOfUy2OqZRennB/GNUdeq7+qaj9Kd8biu8k=; b=o1sfslyMMLGQF23La6zwrKUH3DSBZg86IKkqHeRAB+4O1lIIYMMj9XZEarOmByNP+u dJBf3UlxD/FM5usdSGdVURQiqAALLEtM5NrE3vS/ZHhnuB/PYLqnMEM/KZRrpQwyozht XRp32JxfrIBBwfUBFr4QJPcSQe8FbnrxSLwEN1of9eaLidEy2vwkSJWiEX5SR8soKUlu rA7VnftNwRbV0HrH802MIRrHOsOeexutiww11yPreBk6mBnuiGQAMAkmDwTT2cGFKiVH 6e+SXNZMFCqk1uSJvKVWEqUD+xv5a/YzFA0NRIM2S8kZIK1/s0oyvf/vLTpFEyg6mXez DLbA== 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=rMhauTbDpOfUy2OqZRennB/GNUdeq7+qaj9Kd8biu8k=; b=iWs76sNhpHXVfGb0beHnfHWI7j/rIgcRDu9Qxb53Ck5uDX2LeMqbIrRrCm+2a/PsoK IdEm2GzQFQ8e59HjfPfjwZ4MbEgEoS7BiRY17YKd+L9r2JrklalWF1Lwedfy/MPlJ7Sr 6zRyPQ8awj1nvptn5xEonBZaPoa1eUydnvSONjny+9DGSpU5T/3B5UULl1f2yK+5Fwys LzxUfDBXfzdbTFTdI/aD1VyQ6d1IYk8PZSqSA3nvgM/rv/shDAUaOW/ceJ8HPUT9p6x2 1hN+X+jszEkqTa8cWLDPGqwFwX0DcdE1IUP3ofaDyyp9X7t+z4k6u6lGvOu1xvxgjA8R sN4Q== X-Gm-Message-State: AElRT7G+fZgDE3JDm5ZA/CByEX/uwEQRB/Uuj96hvjndPGmZDPB95l9i eciTAnhZLZDP5cSZL/XwPq5HrnI4 X-Google-Smtp-Source: AG47ELtkK5XJLmKUebAU5UNIS/YrrZ2WztQm0HGhCBEk1I6CChPl81cf3SUChRx4ZJCsnpaAVAN+QQ== X-Received: by 10.223.188.1 with SMTP id s1mr12328383wrg.243.1521528567091; Mon, 19 Mar 2018 23:49:27 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:46 +0000 Message-Id: <20180320064908.17723-4-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.38]); Tue, 20 Mar 2018 06:49:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 20 Mar 2018 06:49:29 +0000 (UTC) for IP:'209.85.128.194' DOMAIN:'mail-wr0-f194.google.com' HELO:'mail-wr0-f194.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.194 mail-wr0-f194.google.com 209.85.128.194 mail-wr0-f194.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 03/25] apibuild: Remove whitespace before ', ' and ':' 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 20 Mar 2018 06:50:02 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" PEP8 recommends removing whitespace immediately before a comma, semicolon, or colon [1]. In addition remove multiple spaces after keyword (PEP8 - E271). 1: https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-= statements Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 104 +++++++++++++++++++--------------= ---- docs/index.py | 22 ++++---- src/esx/esx_vi_generator.py | 102 +++++++++++++++++----------------= --- src/hyperv/hyperv_wmi_generator.py | 32 ++++++------ 4 files changed, 128 insertions(+), 132 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 7507c1d26..73a7535db 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -590,7 +590,7 @@ class CLexer: # line[i] =3D=3D '>' or line[i] =3D=3D '<' or line[i] = =3D=3D '=3D' or \ # line[i] =3D=3D '/' or line[i] =3D=3D '%' or line[i] = =3D=3D '&' or \ # line[i] =3D=3D '!' or line[i] =3D=3D '|' or line[i] = =3D=3D '.': - if line[i] =3D=3D '.' and i + 2 < l and \ + if line[i] =3D=3D '.' and i + 2 < l and \ line[i+1] =3D=3D '.' and line[i+2] =3D=3D '.': self.tokens.append(('name', '...')) i =3D i + 3 @@ -1401,7 +1401,7 @@ class CParser: while token[0] !=3D "sep" or (token[1] !=3D ',' and token[1] !=3D '}'): # We might be dealing with '1U << 12' here - value =3D value + re.sub("^(\d+)U$","\\1", token[1= ]) + value =3D value + re.sub("^(\d+)U$", "\\1", token[= 1]) token =3D self.token() else: try: @@ -1735,7 +1735,7 @@ class CParser: while token is not None and token[0] =3D=3D "op" and token[1] = =3D=3D '*': self.type =3D self.type + token[1] token =3D self.token() - if token is None or token[0] !=3D "name" : + if token is None or token[0] !=3D "name": self.error("parsing function type, name expected", token) return token self.type =3D self.type + token[1] @@ -1825,41 +1825,42 @@ class CParser: # this dict contains the functions that are allowed to use [unsigned] # long for legacy reasons in their signature and return type. this lis= t is # fixed. new procedures and public APIs have to use [unsigned] long lo= ng - long_legacy_functions =3D \ - { "virGetVersion" : (False, ("libVer", "typeVer")), - "virConnectGetLibVersion" : (False, ("libVer")), - "virConnectGetVersion" : (False, ("hvVer")), - "virDomainGetMaxMemory" : (True, ()), - "virDomainMigrate" : (False, ("flags", "bandwidth")), - "virDomainMigrate2" : (False, ("flags", "bandwidth")), - "virDomainMigrateBegin3" : (False, ("flags", "bandwidth")), - "virDomainMigrateConfirm3" : (False, ("flags", "bandwidth")), - "virDomainMigrateDirect" : (False, ("flags", "bandwidth")), - "virDomainMigrateFinish" : (False, ("flags")), - "virDomainMigrateFinish2" : (False, ("flags")), - "virDomainMigrateFinish3" : (False, ("flags")), - "virDomainMigratePeer2Peer" : (False, ("flags", "bandwidth")), - "virDomainMigratePerform" : (False, ("flags", "bandwidth")), - "virDomainMigratePerform3" : (False, ("flags", "bandwidth")), - "virDomainMigratePrepare" : (False, ("flags", "bandwidth")), - "virDomainMigratePrepare2" : (False, ("flags", "bandwidth")), - "virDomainMigratePrepare3" : (False, ("flags", "bandwidth")), - "virDomainMigratePrepareTunnel" : (False, ("flags", "bandwidth")), - "virDomainMigratePrepareTunnel3" : (False, ("flags", "bandwidth")), - "virDomainMigrateToURI" : (False, ("flags", "bandwidth")), - "virDomainMigrateToURI2" : (False, ("flags", "bandwidth")), - "virDomainMigrateVersion1" : (False, ("flags", "bandwidth")), - "virDomainMigrateVersion2" : (False, ("flags", "bandwidth")), - "virDomainMigrateVersion3" : (False, ("flags", "bandwidth")), - "virDomainMigrateSetMaxSpeed" : (False, ("bandwidth")), - "virDomainSetMaxMemory" : (False, ("memory")), - "virDomainSetMemory" : (False, ("memory")), - "virDomainSetMemoryFlags" : (False, ("memory")), - "virDomainBlockCommit" : (False, ("bandwidth")), - "virDomainBlockJobSetSpeed" : (False, ("bandwidth")), - "virDomainBlockPull" : (False, ("bandwidth")), - "virDomainBlockRebase" : (False, ("bandwidth")), - "virDomainMigrateGetMaxSpeed" : (False, ("bandwidth")) } + long_legacy_functions =3D { + "virGetVersion": (False, ("libVer", "typeVer")), + "virConnectGetLibVersion": (False, ("libVer")), + "virConnectGetVersion": (False, ("hvVer")), + "virDomainGetMaxMemory": (True, ()), + "virDomainMigrate": (False, ("flags", "bandwidth")), + "virDomainMigrate2": (False, ("flags", "bandwidth")), + "virDomainMigrateBegin3": (False, ("flags", "bandwidth")), + "virDomainMigrateConfirm3": (False, ("flags", "bandwidth")), + "virDomainMigrateDirect": (False, ("flags", "bandwidth")), + "virDomainMigrateFinish": (False, ("flags")), + "virDomainMigrateFinish2": (False, ("flags")), + "virDomainMigrateFinish3": (False, ("flags")), + "virDomainMigratePeer2Peer": (False, ("flags", "bandwidth")), + "virDomainMigratePerform": (False, ("flags", "bandwidth")), + "virDomainMigratePerform3": (False, ("flags", "bandwidth")), + "virDomainMigratePrepare": (False, ("flags", "bandwidth")), + "virDomainMigratePrepare2": (False, ("flags", "bandwidth")), + "virDomainMigratePrepare3": (False, ("flags", "bandwidth")), + "virDomainMigratePrepareTunnel": (False, ("flags", "bandwidth")), + "virDomainMigratePrepareTunnel3": (False, ("flags", "bandwidth")), + "virDomainMigrateToURI": (False, ("flags", "bandwidth")), + "virDomainMigrateToURI2": (False, ("flags", "bandwidth")), + "virDomainMigrateVersion1": (False, ("flags", "bandwidth")), + "virDomainMigrateVersion2": (False, ("flags", "bandwidth")), + "virDomainMigrateVersion3": (False, ("flags", "bandwidth")), + "virDomainMigrateSetMaxSpeed": (False, ("bandwidth")), + "virDomainSetMaxMemory": (False, ("memory")), + "virDomainSetMemory": (False, ("memory")), + "virDomainSetMemoryFlags": (False, ("memory")), + "virDomainBlockCommit": (False, ("bandwidth")), + "virDomainBlockJobSetSpeed": (False, ("bandwidth")), + "virDomainBlockPull": (False, ("bandwidth")), + "virDomainBlockRebase": (False, ("bandwidth")), + "virDomainMigrateGetMaxSpeed": (False, ("bandwidth")) + } =20 def checkLongLegacyFunction(self, name, return_type, signature): if "long" in return_type and "long long" not in return_type: @@ -1883,10 +1884,11 @@ class CParser: # this dict contains the structs that are allowed to use [unsigned] # long for legacy reasons. this list is fixed. new structs have to use # [unsigned] long long - long_legacy_struct_fields =3D \ - { "_virDomainInfo" : ("maxMem", "memory"), - "_virNodeInfo" : ("memory"), - "_virDomainBlockJobInfo" : ("bandwidth") } + long_legacy_struct_fields =3D { + "_virDomainInfo": ("maxMem", "memory"), + "_virNodeInfo": ("memory"), + "_virDomainBlockJobInfo": ("bandwidth") + } =20 def checkLongLegacyStruct(self, name, fields): for field in fields: @@ -1934,7 +1936,7 @@ class CParser: elif token[1] =3D=3D 'static': static =3D 1 token =3D self.token() - if token is None or token[0] !=3D 'name': + if token is None or token[0] !=3D 'name': return token =20 if token[1] =3D=3D 'typedef': @@ -2205,7 +2207,7 @@ class docBuilder: output.write(" \n") =20 def serialize_union(self, output, field, desc): - output.write(" = \n" % (field[1] , desc)) + output.write(" = \n" % (field[1], desc)) output.write(" \n") for f in field[3]: desc =3D f[2] @@ -2213,7 +2215,7 @@ class docBuilder: desc =3D '' else: desc =3D escape(desc) - output.write(" \n" % (f[1] , f[0], desc)) + output.write(" \n" % (f[1], f[0], desc)) =20 output.write(" \n") output.write(" \n") @@ -2238,13 +2240,13 @@ class docBuilder: if field[0] =3D=3D "union": self.serialize_union(output, field, desc) else: - output.write(" \n" % (field[1] , field[0], desc)) + output.write(" \n" % (field[1], field[0], desc)) except: self.warning("Failed to serialize struct %s" % (name)) output.write(" \n") else: output.write("/>\n") - else : + else: output.write(" \n" % (type)) ids =3D funcs[type] @@ -2430,7 +2432,7 @@ class docBuilder: typ =3D sorted(funcs.keys()) for type in typ: if type =3D=3D '' or type =3D=3D 'void' or type =3D=3D "int" o= r \ - type =3D=3D "char *" or type =3D=3D "const char *" : + type =3D=3D "char *" or type =3D=3D "const char *": continue output.write(" \n" % (type)) ids =3D sorted(funcs[type]) @@ -2589,7 +2591,7 @@ class app: builddir =3D os.path.abspath((os.environ["builddir"])) if srcdir =3D=3D builddir: builddir =3D None - if glob.glob(srcdir + "/../src/libvirt.c") !=3D [] : + if glob.glob(srcdir + "/../src/libvirt.c") !=3D []: if not quiet: print("Rebuilding API description for %s" % name) dirs =3D [srcdir + "/../src", @@ -2599,7 +2601,7 @@ class app: not os.path.exists(srcdir + "/../include/libvirt/libvirt-c= ommon.h")): dirs.append(builddir + "/../include/libvirt") builder =3D docBuilder(name, srcdir, dirs, []) - elif glob.glob("src/libvirt.c") !=3D [] : + elif glob.glob("src/libvirt.c") !=3D []: if not quiet: print("Rebuilding API description for %s" % name) builder =3D docBuilder(name, srcdir, diff --git a/docs/index.py b/docs/index.py index bedec8ae0..e2f9185c3 100755 --- a/docs/index.py +++ b/docs/index.py @@ -59,21 +59,21 @@ libxml2.registerErrorHandler(callback, None) # to create them # TABLES=3D{ - "symbols" : """CREATE TABLE symbols ( + "symbols": """CREATE TABLE symbols ( name varchar(255) BINARY NOT NULL, module varchar(255) BINARY NOT NULL, type varchar(25) NOT NULL, descr varchar(255), UNIQUE KEY name (name), KEY module (module))""", - "words" : """CREATE TABLE words ( + "words": """CREATE TABLE words ( name varchar(50) BINARY NOT NULL, symbol varchar(255) BINARY NOT NULL, relevance int, KEY name (name), KEY symbol (symbol), UNIQUE KEY ID (name, symbol))""", - "wordsHTML" : """CREATE TABLE wordsHTML ( + "wordsHTML": """CREATE TABLE wordsHTML ( name varchar(50) BINARY NOT NULL, resource varchar(255) BINARY NOT NULL, section varchar(255), @@ -82,30 +82,30 @@ TABLES=3D{ KEY name (name), KEY resource (resource), UNIQUE KEY ref (name, resource))""", - "wordsArchive" : """CREATE TABLE wordsArchive ( + "wordsArchive": """CREATE TABLE wordsArchive ( name varchar(50) BINARY NOT NULL, ID int(11) NOT NULL, relevance int, KEY name (name), UNIQUE KEY ref (name, ID))""", - "pages" : """CREATE TABLE pages ( + "pages": """CREATE TABLE pages ( resource varchar(255) BINARY NOT NULL, title varchar(255) BINARY NOT NULL, UNIQUE KEY name (resource))""", - "archives" : """CREATE TABLE archives ( + "archives": """CREATE TABLE archives ( ID int(11) NOT NULL auto_increment, resource varchar(255) BINARY NOT NULL, title varchar(255) BINARY NOT NULL, UNIQUE KEY id (ID,resource(255)), INDEX (ID), INDEX (resource))""", - "Queries" : """CREATE TABLE Queries ( + "Queries": """CREATE TABLE Queries ( ID int(11) NOT NULL auto_increment, Value varchar(50) NOT NULL, Count int(11) NOT NULL, UNIQUE KEY id (ID,Value(35)), INDEX (ID))""", - "AllQueries" : """CREATE TABLE AllQueries ( + "AllQueries": """CREATE TABLE AllQueries ( ID int(11) NOT NULL auto_increment, Value varchar(50) NOT NULL, Count int(11) NOT NULL, @@ -171,7 +171,7 @@ def checkTables(db, verbose =3D 1): if verbose: print "Table %s contains %d records" % (table, row[0]) except: - print "Troubles with table %s : repairing" % (table) + print "Troubles with table %s: repairing" % (table) ret =3D c.execute("repair table %s" % table) print "repairing returned %d" % (ret) ret =3D c.execute("SELECT count(*) from %s" % table) @@ -1041,7 +1041,7 @@ def analyzeHTMLPages(): doc =3D libxml2.htmlParseFile(html, None) try: res =3D analyzeHTML(doc, html) - print "Parsed %s : %d paragraphs" % (html, res) + print "Parsed %s: %d paragraphs" % (html, res) ret =3D ret + 1 except: print "could not parse %s" % (html) @@ -1230,7 +1230,7 @@ def main(): elif args[i] =3D=3D '--archive-year': i =3D i + 1 year =3D args[i] - months =3D ["January" , "February", "March", "April", "May= ", + months =3D ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] for month in months: diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py index 545f8bdda..17ac43cb7 100755 --- a/src/esx/esx_vi_generator.py +++ b/src/esx/esx_vi_generator.py @@ -1342,61 +1342,53 @@ predefined_objects =3D ["AnyType", "MethodFault", "ManagedObjectReference"] =20 -additional_enum_features =3D { "ManagedEntityStatus" : Enum.FEATURE__= ANY_TYPE, - "TaskInfoState" : Enum.FEATURE__AN= Y_TYPE, - "VirtualMachinePowerState" : Enum.FEATURE__AN= Y_TYPE } - -additional_object_features =3D { "AutoStartDefaults" : Object.FEA= TURE__ANY_TYPE, - "AutoStartPowerInfo" : Object.FEATU= RE__ANY_TYPE, - "DatastoreHostMount" : Object.FEATU= RE__DEEP_COPY | - Object.FEATU= RE__LIST | - Object.FEATU= RE__ANY_TYPE, - "DatastoreInfo" : Object.FEATU= RE__ANY_TYPE | - Object.FEATU= RE__DYNAMIC_CAST, - "HostConfigManager" : Object.FEATU= RE__ANY_TYPE, - "HostCpuIdInfo" : Object.FEATU= RE__LIST | - Object.FEATU= RE__ANY_TYPE, - "HostDatastoreBrowserSearchResults" : Objec= t.FEATURE__LIST | - Object.FEATU= RE__ANY_TYPE, - "HostHostBusAdapter" : Object.FEATU= RE__LIST | - Object.FEATU= RE__ANY_TYPE, - "HostInternetScsiHba" : Object.FEATU= RE__DYNAMIC_CAST | - Object.FEATU= RE__DEEP_COPY, - "HostInternetScsiTargetTransport" : Object= .FEATURE__DYNAMIC_CAST, - "HostScsiDisk" : Object.FEATU= RE__LIST | - Object.FEATU= RE__ANY_TYPE | - Object.FEATU= RE__DYNAMIC_CAST, - "HostScsiTopologyInterface" : Object.FEATU= RE__LIST | - Object.FEATU= RE__ANY_TYPE, - "HostScsiTopologyLun" : Object.FEATU= RE__ANY_TYPE | - Object.FEATU= RE__LIST | - Object.FEATU= RE__DEEP_COPY, - "HostScsiTopologyTarget" : Object.FEATU= RE__ANY_TYPE | - Object.FEATU= RE__LIST, - "HostPortGroup" : Object.FEATU= RE__LIST | - Object.FEATU= RE__ANY_TYPE, - "HostVirtualSwitch" : Object.FEATU= RE__DEEP_COPY | - Object.FEATU= RE__LIST | - Object.FEATU= RE__ANY_TYPE, - "ManagedObjectReference" : Object.FEATU= RE__ANY_TYPE, - "ObjectContent" : Object.FEATU= RE__DEEP_COPY, - "PhysicalNic" : Object.FEATU= RE__DEEP_COPY | - Object.FEATU= RE__LIST | - Object.FEATU= RE__ANY_TYPE, - "ResourcePoolResourceUsage" : Object.FEATU= RE__ANY_TYPE, - "ScsiLun" : Object.FEATU= RE__LIST | - Object.FEATU= RE__ANY_TYPE | - Object.FEATU= RE__DEEP_COPY, - "ScsiLunDurableName" : Object.FEATU= RE__LIST, - "ServiceContent" : Object.FEATU= RE__DESERIALIZE, - "SharesInfo" : Object.FEATU= RE__ANY_TYPE, - "TaskInfo" : Object.FEATU= RE__LIST | - Object.FEATU= RE__ANY_TYPE, - "UserSession" : Object.FEATU= RE__ANY_TYPE, - "VirtualMachineQuestionInfo" : Object.FEATU= RE__ANY_TYPE, - "VirtualMachineSnapshotTree" : Object.FEATU= RE__DEEP_COPY | - Object.FEATU= RE__ANY_TYPE, - "VmEventArgument" : Object.FEATU= RE__DESERIALIZE } +additional_enum_features =3D { + "ManagedEntityStatus": Enum.FEATURE__ANY_TYPE, + "TaskInfoState": Enum.FEATURE__ANY_TYPE, + "VirtualMachinePowerState": Enum.FEATURE__ANY_TYPE +} + +additional_object_features =3D { + "AutoStartDefaults": Object.FEATURE__ANY_TYPE, + "AutoStartPowerInfo": Object.FEATURE__ANY_TYPE, + "DatastoreHostMount": (Object.FEATURE__DEEP_COPY | Object.FEATURE__LIS= T | + Object.FEATURE__ANY_TYPE), + "DatastoreInfo": Object.FEATURE__ANY_TYPE | Object.FEATURE__DYNAMIC_CA= ST, + "HostConfigManager": Object.FEATURE__ANY_TYPE, + "HostCpuIdInfo": Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE, + "HostDatastoreBrowserSearchResults": (Object.FEATURE__LIST | + Object.FEATURE__ANY_TYPE), + "HostHostBusAdapter": Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE, + "HostInternetScsiHba": (Object.FEATURE__DYNAMIC_CAST | + Object.FEATURE__DEEP_COPY), + "HostInternetScsiTargetTransport": Object.FEATURE__DYNAMIC_CAST, + "HostScsiDisk": (Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE | + Object.FEATURE__DYNAMIC_CAST), + "HostScsiTopologyInterface": (Object.FEATURE__LIST | + Object.FEATURE__ANY_TYPE), + "HostScsiTopologyLun": (Object.FEATURE__ANY_TYPE | Object.FEATURE__LIS= T | + Object.FEATURE__DEEP_COPY), + "HostScsiTopologyTarget": Object.FEATURE__ANY_TYPE | Object.FEATURE__L= IST, + "HostPortGroup": Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE, + "HostVirtualSwitch": (Object.FEATURE__DEEP_COPY | Object.FEATURE__LIST= | + Object.FEATURE__ANY_TYPE), + "ManagedObjectReference": Object.FEATURE__ANY_TYPE, + "ObjectContent": Object.FEATURE__DEEP_COPY, + "PhysicalNic": (Object.FEATURE__DEEP_COPY | Object.FEATURE__LIST | + Object.FEATURE__ANY_TYPE), + "ResourcePoolResourceUsage": Object.FEATURE__ANY_TYPE, + "ScsiLun": (Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE | + Object.FEATURE__DEEP_COPY), + "ScsiLunDurableName": Object.FEATURE__LIST, + "ServiceContent": Object.FEATURE__DESERIALIZE, + "SharesInfo": Object.FEATURE__ANY_TYPE, + "TaskInfo": Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE, + "UserSession": Object.FEATURE__ANY_TYPE, + "VirtualMachineQuestionInfo": Object.FEATURE__ANY_TYPE, + "VirtualMachineSnapshotTree": (Object.FEATURE__DEEP_COPY | + Object.FEATURE__ANY_TYPE), + "VmEventArgument": Object.FEATURE__DESERIALIZE +} =20 removed_object_features =3D {} =20 diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_gen= erator.py index 9e7ea4382..6e98f0a89 100755 --- a/src/hyperv/hyperv_wmi_generator.py +++ b/src/hyperv/hyperv_wmi_generator.py @@ -342,21 +342,23 @@ class WmiClassVersion: =20 =20 class Property: - typemap =3D {"boolean" : "BOOL", - "string" : "STR", - "datetime" : "STR", - "int8" : "INT8", - "sint8" : "INT8", - "int16" : "INT16", - "sint16" : "INT16", - "int32" : "INT32", - "sint32" : "INT32", - "int64" : "INT64", - "sint64" : "INT64", - "uint8" : "UINT8", - "uint16" : "UINT16", - "uint32" : "UINT32", - "uint64" : "UINT64"} + typemap =3D { + "boolean": "BOOL", + "string": "STR", + "datetime": "STR", + "int8": "INT8", + "sint8": "INT8", + "int16": "INT16", + "sint16": "INT16", + "int32": "INT32", + "sint32": "INT32", + "int64": "INT64", + "sint64": "INT64", + "uint8": "UINT8", + "uint16": "UINT16", + "uint32": "UINT32", + "uint64": "UINT64" + } =20 =20 def __init__(self, type, name, is_array): --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 152152860624165.85825389896092; Mon, 19 Mar 2018 23:50:06 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 054994ACA4; Tue, 20 Mar 2018 06:50:05 +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 CE7F35C545; Tue, 20 Mar 2018 06:50:04 +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 361154CAA8; Tue, 20 Mar 2018 06:50:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nXB1019392 for ; Tue, 20 Mar 2018 02:49:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id A6662D1E4; Tue, 20 Mar 2018 06:49:33 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0F1C6065F for ; Tue, 20 Mar 2018 06:49:31 +0000 (UTC) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) (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 378B323E6C1 for ; Tue, 20 Mar 2018 06:49:30 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id z8so458980wrh.7 for ; Mon, 19 Mar 2018 23:49:30 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:27 -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=QmMGc5YmIPWpNQ4ll/33YCJIFJBRZ+YcpiNOT+kQR34=; b=VGBgq7GxKesY55PBEqWESjhroWWiL3iA/rBygtDIJk+wwq/8p84lJQlAWCe8sv+0wh CMrropdK0201r89sEQXba9rPCaoPlw+Bhvmpm+u13D0LTRh0qCsburtg7hJwIZYd81am yhi9AHJf24t5qBdDeT5gSI+0H6gAKQQ8X4KDTK7hm0Di1WyDTvS+Lg9fPOv558CPVW8p QZpxrcxnkCTb3dFjEcsBdPFMZea9sJQ8WIIYYfME/TWqp5703pa7q5846NkKh8fXoWeS 1PYpOhqC+7I2y0H594NgExSmTdbtAZOPg7K2EkkzFrmkjN5qy9cSdS306zBTqZTbJQlf LAUA== 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=QmMGc5YmIPWpNQ4ll/33YCJIFJBRZ+YcpiNOT+kQR34=; b=sPgPW/KylgmOfZ3v2xPOj3fM5AeSzC0pEWbVD2AUC7KJjwMYHvA9tXpecbMEi4HGfQ 3kGI7CVNT58Q/VHIQ6fWP7fxoU9Ds/9N1O4mvjlzmzKERLS+UTPf/mLFR65g0yKhPL6k g4A8aOZNqtky9lnlccOaT34ztwP0o6gp+mKZ50TsULzLIZaw0yo5APw77oz4s1OdM1cp tadULs2RFOFRltL/PGCeclf71dazieqxpnGjD+iY10c7ptEyMStotKDm05t60Lxv5KpF YsdDfcNjO3Lq2UmpeHRrca7lXmUkOyHafzmhiqQpxSzz4KuVdZPSSjDzMyLq4zgaUASr sZUQ== X-Gm-Message-State: AElRT7HJfR4D+Gn5dr7yTfxKMuiR1HuBKgQNZecB7POzEBN8yLB0LR66 8lFmH9qY98oCvHm1DXIvmlnrEofk X-Google-Smtp-Source: AG47ELt7ehKrtT0enGXbsu659jh8/cV/oATIhzXEYCst3HtDgs567AQaCK63m8+IaAHMrVFfFB2Azw== X-Received: by 10.223.174.2 with SMTP id x2mr12513040wrc.211.1521528568551; Mon, 19 Mar 2018 23:49:28 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:47 +0000 Message-Id: <20180320064908.17723-5-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.29]); Tue, 20 Mar 2018 06:49:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 20 Mar 2018 06:49:30 +0000 (UTC) for IP:'209.85.128.196' DOMAIN:'mail-wr0-f196.google.com' HELO:'mail-wr0-f196.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.196 mail-wr0-f196.google.com 209.85.128.196 mail-wr0-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 04/25] python: Add whitespace around = and % operators 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 20 Mar 2018 06:50:05 +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" Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 18 +++++++++--------- docs/index.py | 6 +++--- tests/cputestdata/cpu-cpuid.py | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 73a7535db..a11c2d145 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -15,10 +15,10 @@ import sys import glob import re =20 -quiet=3DTrue -warnings=3D0 -debug=3DFalse -debugsym=3DNone +quiet =3D True +warnings =3D 0 +debug =3D False +debugsym =3D None =20 # # C parser analysis code @@ -132,7 +132,7 @@ def escape(raw): def uniq(items): d =3D {} for item in items: - d[item]=3D1 + d[item] =3D 1 k =3D sorted(d.keys()) return k =20 @@ -1408,7 +1408,7 @@ class CParser: value =3D "%d" % (int(value) + 1) except: self.warning("Failed to compute value of enum %s" = % (name)) - value=3D"" + value =3D "" if token[0] =3D=3D "sep" and token[1] =3D=3D ",": if commentsBeforeVal: self.cleanupComment() @@ -2286,7 +2286,7 @@ class docBuilder: if apstr !=3D "": apstr =3D apstr + " && " apstr =3D apstr + cond - output.write(" %s\n"% (apstr)) + output.write(" %s\n" % (apstr)) try: (ret, params, desc) =3D id.info output.write(" \n" % (desc)) @@ -2479,7 +2479,7 @@ class docBuilder: output.write(" \n") output.write(" \n") count =3D 0 - chunks.append(["chunk%s" % (chunk -1), first_lette= r, letter]) + chunks.append(["chunk%s" % (chunk - 1), first_lett= er, letter]) output.write(" \n" % (chunk= )) first_letter =3D id[0] chunk =3D chunk + 1 @@ -2502,7 +2502,7 @@ class docBuilder: output.write(" \n") output.write(" \n") if count !=3D 0: - chunks.append(["chunk%s" % (chunk -1), first_letter, lette= r]) + chunks.append(["chunk%s" % (chunk - 1), first_letter, lett= er]) output.write(" \n") for ch in chunks: output.write(" \n" % ( diff --git a/docs/index.py b/docs/index.py index e2f9185c3..5224324b1 100755 --- a/docs/index.py +++ b/docs/index.py @@ -58,7 +58,7 @@ libxml2.registerErrorHandler(callback, None) # The dictionary of tables required and the SQL command needed # to create them # -TABLES=3D{ +TABLES =3D { "symbols": """CREATE TABLE symbols ( name varchar(255) BINARY NOT NULL, module varchar(255) BINARY NOT NULL, @@ -116,8 +116,8 @@ TABLES=3D{ # # The XML API description file to parse # -API=3D"libvirt-api.xml" -DB=3DNone +API =3D "libvirt-api.xml" +DB =3D None =20 ######################################################################### # # diff --git a/tests/cputestdata/cpu-cpuid.py b/tests/cputestdata/cpu-cpuid.py index b74c3ce93..43c92731a 100755 --- a/tests/cputestdata/cpu-cpuid.py +++ b/tests/cputestdata/cpu-cpuid.py @@ -325,7 +325,7 @@ def formatCpuid(cpuid, path, comment): line =3D (" \n") - f.write(line %( + f.write(line % ( in_eax, in_ecx, leaf["eax"], leaf["ebx"], leaf["ecx"], leaf["edx"]= )) f.write("\n") --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528607752699.6627730870753; Mon, 19 Mar 2018 23:50:07 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3397EA89C; Tue, 20 Mar 2018 06:50:06 +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 ED5E6424E; Tue, 20 Mar 2018 06:50:05 +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 9CB374CAB1; Tue, 20 Mar 2018 06:50:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nYdM019403 for ; Tue, 20 Mar 2018 02:49:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 76E2B5C888; Tue, 20 Mar 2018 06:49:34 +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 6F1255C70F for ; Tue, 20 Mar 2018 06:49:32 +0000 (UTC) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) (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 6B0F5C04AC5C for ; Tue, 20 Mar 2018 06:49:31 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id l16so1273273wmh.3 for ; Mon, 19 Mar 2018 23:49:31 -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.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:29 -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=jTnjCWOp47Bk4Zrdg6T083NOgQJwYH9zE0U/0sM1rsg=; b=pR5r8Bxq59++oDvOEQOMLfUMgSgxyQbvPGTsz5LTwxY2ev0Nd4MaBHNcHW6FL3Qs78 pKypPcs2x1AWla9y9tWlBwIvFYpqBB3VS/byv7DGu4x0ejXaZ+4I63BuETXJaNTaSemd hwl3Dc/DIoJgKAKyrWz0+sChyJz4b8shuIq7Ynf+cQJ8Z0oMsjwgwezB2Jpuks8rHyLK sgaKLMqzvhFNrN2wjRxuuPZ8kfdZ321fxjad2ae5lHMIJihOKQbx1UiEjOTTeD58krqF JWbaTmo0pHSb8o9b4ZBUrvS/WBfHh2b+VoIo1+TKKBfaK+HsQ2iPvrlko7Hd/vr+JNGv aNzQ== 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=jTnjCWOp47Bk4Zrdg6T083NOgQJwYH9zE0U/0sM1rsg=; b=s4LpCMc4YoIIRLBM90Ux5FvX3hGHsEbDPY2NKYmkVPPhYVpghlkKP9vK9iIZllAEDr PPfavq53zm56Ha12EDe8G/I+NcIP59HJ14GVK7npzF/BTWZ5FAgIX49MRyHafbh9Mnz4 ls/M/KzzWhoW4Ux3Lxroqvidf+DSewnETqdn8TBiQVETl18Zb9O1iUYrOiZf4+CGC5ea +ZfR64K6d84KiWZ2u/5hpdqyMrg0HMB/HVWlr+vnva3f1994KgjFu+F2lO7BkyMfZaWm VaaU7qVGoxCb83rT2f+zX4BGeCQOyzqI5JrmqMZOrQ/78MfUVbsyMy2VSGH+AzsdB6LF 232A== X-Gm-Message-State: AElRT7G0rwz4kykvNaNqflnwlzdT+PU/F3wZ5cHFwUF963nGr+Q36cng /CJMCgD8RT9aZ/wSynLxiID7cAxL X-Google-Smtp-Source: AG47ELus6SPn+yOcpLkINntVQfkLRvdfXQrFnfRkoUQC40RDShBQUASMjEMQFFR5JTM7Fcj7y0LZiQ== X-Received: by 10.28.174.11 with SMTP id x11mr1087316wme.124.1521528569859; Mon, 19 Mar 2018 23:49:29 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:48 +0000 Message-Id: <20180320064908.17723-6-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:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 20 Mar 2018 06:49:31 +0000 (UTC) for IP:'74.125.82.66' DOMAIN:'mail-wm0-f66.google.com' HELO:'mail-wm0-f66.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.66 mail-wm0-f66.google.com 74.125.82.66 mail-wm0-f66.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 05/25] esx_vi_generator: Simplify generate_helper_source 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 20 Mar 2018 06:50:06 +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" The generate_helper_source() function returns a formatted string. This could be achieved without the use of a local variable "source" and string concatenation. Signed-off-by: Radostin Stoyanov --- src/esx/esx_vi_generator.py | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py index 17ac43cb7..8f581c41e 100755 --- a/src/esx/esx_vi_generator.py +++ b/src/esx/esx_vi_generator.py @@ -1092,26 +1092,19 @@ class ManagedObject(GenericObject): =20 =20 def generate_helper_source(self): - source =3D "" - # lookup - source +=3D "/* esxVI_Lookup%s */\n" % self.name - source +=3D "ESX_VI__TEMPLATE__LOOKUP(%s,\n" % self.name - source +=3D "{\n" - - source +=3D self.generate_lookup_code1() - - source +=3D "},\n" - source +=3D "{\n" - - source +=3D self.generate_lookup_code2() - - source +=3D "})\n\n" - - source +=3D "\n\n" - - return source - + return ( + "/* esxVI_Lookup%(name)s */\n" + "ESX_VI__TEMPLATE__LOOKUP(%(name)s,\n" + "{\n" + "%(lookup_code1)s},\n" + "{\n" + "%(lookup_code2)s})" + "\n\n\n\n" + % {"name": self.name, + "lookup_code1": self.generate_lookup_code1(), + "lookup_code2": self.generate_lookup_code2()} + ) =20 =20 class Enum(Type): --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528599540959.8660193221169; Mon, 19 Mar 2018 23:49:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 52C33804E2; Tue, 20 Mar 2018 06:49:58 +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 20E0F5D6A8; Tue, 20 Mar 2018 06:49:58 +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 D5D624CAA4; Tue, 20 Mar 2018 06:49:57 +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 w2K6nZj5019423 for ; Tue, 20 Mar 2018 02:49:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id E8911190C9; Tue, 20 Mar 2018 06:49:35 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E25D160A9E for ; Tue, 20 Mar 2018 06:49:33 +0000 (UTC) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) (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 D3B6780467 for ; Tue, 20 Mar 2018 06:49:32 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id l16so1273378wmh.3 for ; Mon, 19 Mar 2018 23:49:32 -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.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:30 -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=P2EwZUZ4LstnHhjtrf8VI9REcLfKzJLFw2frusdkRYM=; b=rN0SDkHPbODg46jo+6y6ylsrd51bpxGliJnnOVtMjssIj+Cs0HxWbkLnaJSXFIN7qc wFaktjc5dLVkgVSvMXXJajfWy2ubfoY7y94J0/gQf7D4i2XEfiTKqlU5z4im/CNFOGLu JV5ArYtyfEj7dINp8hqT7UJMpf2ivsnProoRDsWvx0RfdBGS/oXe1/v16Z+vfAHnAzDa c4V3O5kpU8KgZ4FIkXPACDlP5dnyNPbOQG/eom003UIwTlgOyFhJIuf9jRZkHaiPXL73 owmEzVUXztgQjJIVFkR379uMZv9p6p9C7dUhaPix+5FTJHyDfHvjHAHiWXuCnOxT6V51 vsMg== 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=P2EwZUZ4LstnHhjtrf8VI9REcLfKzJLFw2frusdkRYM=; b=BVVdTBvxgmjFZGCwCUGkZEP5aEdg/PCgqkW7xOBx+gfK2dWQ6ql2n4Bs5Ou7MRzYmB DPo7DHasxPj5rmM26ZMb3LbQ/cJAzraVxgmlJ/6il/3Wb3JbS4jETq/0FPTbrrpidegC vFGTs1uz+9W4tZUOziR5l7rvw1D9G10Mz17hVY+Ef9p7tHtM9d2yPwabWpgsRZLGAYvM AgRknW7Q5pZ74zQ22nKsitT61Khjdf31xOcNmcB0MlRdNGR+cIhI9GjAfPQbtDpLfgxf ZujG9P5zVTUtiBNRK/aPo5MYWj6E8fAaf7uNHzZ8mBgDtevaJkn0ZPUN6l9DZ4N1kt7M t9Cw== X-Gm-Message-State: AElRT7HVx8dkBXklaJ+U3Zq3mlYdeR8/FmOwANIpOCwUTUW3+djlRHhD HlXPzy56DcqEh8JosiG8R+1JPYXk X-Google-Smtp-Source: AG47ELtaI5WYosIs6ZZVNkgsojljR23ATJeI6vrQrpjJ4/F+yosI46oTpvVlpLyz1nMZdS5eqjblCg== X-Received: by 10.28.32.210 with SMTP id g201mr937007wmg.9.1521528571143; Mon, 19 Mar 2018 23:49:31 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:49 +0000 Message-Id: <20180320064908.17723-7-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.28]); Tue, 20 Mar 2018 06:49:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 20 Mar 2018 06:49:33 +0000 (UTC) for IP:'74.125.82.68' DOMAIN:'mail-wm0-f68.google.com' HELO:'mail-wm0-f68.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.68 mail-wm0-f68.google.com 74.125.82.68 mail-wm0-f68.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 06/25] esx_vi_generator: Simplify generate_helper_header 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 20 Mar 2018 06:49:58 +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" The function generate_helper_header() only returns a formatted string. This could be achieved without performing string concatenation. Signed-off-by: Radostin Stoyanov --- src/esx/esx_vi_generator.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py index 8f581c41e..95521fa1e 100755 --- a/src/esx/esx_vi_generator.py +++ b/src/esx/esx_vi_generator.py @@ -1021,20 +1021,16 @@ class ManagedObject(GenericObject): =20 =20 def generate_helper_header(self): - header =3D "" - # functions - header +=3D ("int esxVI_Lookup%s(esxVI_Context *ctx, " - "const char *name, " - "esxVI_ManagedObjectReference *root,= " - "esxVI_String *selectedPropertyNameL= ist, " - "esxVI_%s **item, " - "esxVI_Occurrence occurrence);\n") \ - % (self.name, self.name) - - header +=3D "\n" - - return header + return ( + "int esxVI_Lookup%(name)s(esxVI_Context *ctx," + " const char *name," + " esxVI_ManagedObjectReference *root," + " esxVI_String *selectedPropertyNameL= ist," + " esxVI_%(name)s **item," + " esxVI_Occurrence occurrence);\n\n" + % {"name": self.name} + ) =20 =20 def generate_source(self): --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528580266570.0834962885218; Mon, 19 Mar 2018 23:49:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 91F93C04BD24; Tue, 20 Mar 2018 06:49:38 +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 66C5F5C545; Tue, 20 Mar 2018 06:49:38 +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 954114CA9D; Tue, 20 Mar 2018 06:49:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nZEr019414 for ; Tue, 20 Mar 2018 02:49:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 16C8AC5DA7; Tue, 20 Mar 2018 06:49:35 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0E4855C545 for ; Tue, 20 Mar 2018 06:49:35 +0000 (UTC) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) (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 4294683F3E for ; Tue, 20 Mar 2018 06:49:34 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id t7so1190923wmh.5 for ; Mon, 19 Mar 2018 23:49:34 -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.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:31 -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=gECFdDxTN9g6JXe367QO+qCh0v0duX7aNpkYL/oSynA=; b=et9M0Fq3SyzLpgJDcOQmWknEwx7GtDarTfI/+BJmhB16YsvmrnYXVQPcXHjVOZqwlo cIiTXey6PW1N+I3Y4nkqbEwXlGp+qQVujFuJtpwmCgGn5m9O/jVky8kOUduzXoxtzmYg V9LhADv4+wb6XCiyFGCnXGilG3+GHieAqbYH5v8hWXz2CKNXh2803T0YdLNnK9+ubjYm IJ8+a4w/H7w+pqcpyH/1SQTc1aoWb/DPsVueumGaa8/fKRmX8q6eM4BETX8RRKgpEcZv 9OHTbE/uunjWVP24GvEuv6ApKG2KqT7PtXJmpG0WpOcC4Y1OuINrdwm/G+rvdxqB6GVD OjWg== 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=gECFdDxTN9g6JXe367QO+qCh0v0duX7aNpkYL/oSynA=; b=oGKGDLegSqVBm5+5EbusOJX/9pPj03cUYN0tNGdRr+/LVT22TYz6xEtablgfAx6bZc j3llrbaVg7Fw+/x8cce8u06uzYDPoFUTlWyqk7F4t0k8XY993xjGcrNGK1+j6LJTr6g2 0guD/0mTVAQvdQ1h0OHpYvuh/ZC7bX6A5r0WY+DhGkDJBSsCSENN/vHaB91F9/8u0chy LaMglSBVQ6GQO79FWyMJV3v1zPv0XKDwrn3n9ThQCGGLLlFF/Xqlhd8fJ5RouRnoWJ9T OhpTLtpy8OG32yICMdnYbJHeDZcsxZRhWO/GLP17t9cbjlyt5gwSsot8sNXZi817sHnX mKlQ== X-Gm-Message-State: AElRT7EsfpVbaFHhIYabGVx50GWir8eV43DRS0Fkc5YByt6SJpmMphfg Bmkgmx2CBE5FQkdgbdf7ShzSao5l X-Google-Smtp-Source: AG47ELvIJ2Gre9evu8hD2nRYJcytj3zWpOhv1Qh7LsyTtTPJM34NmP1j9i0E97w+AsKUrrZxU8ZIVw== X-Received: by 10.28.161.4 with SMTP id k4mr990271wme.132.1521528572684; Mon, 19 Mar 2018 23:49:32 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:50 +0000 Message-Id: <20180320064908.17723-8-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.27]); Tue, 20 Mar 2018 06:49:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 20 Mar 2018 06:49:34 +0000 (UTC) for IP:'74.125.82.68' DOMAIN:'mail-wm0-f68.google.com' HELO:'mail-wm0-f68.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.68 mail-wm0-f68.google.com 74.125.82.68 mail-wm0-f68.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 07/25] esx_vi_generator: Simplify get_occurrence_comment 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.16 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:39 +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" Reduce the number of if-statements and use a single return. Utilise a dictionary to map between occurrences and values. Signed-off-by: Radostin Stoyanov --- src/esx/esx_vi_generator.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py index 95521fa1e..df913d891 100755 --- a/src/esx/esx_vi_generator.py +++ b/src/esx/esx_vi_generator.py @@ -75,16 +75,17 @@ class Member: =20 =20 def get_occurrence_comment(self): - if self.occurrence =3D=3D OCCURRENCE__REQUIRED_ITEM: - return "/* required */" - elif self.occurrence =3D=3D OCCURRENCE__REQUIRED_LIST: - return "/* required, list */" - elif self.occurrence =3D=3D OCCURRENCE__OPTIONAL_ITEM: - return "/* optional */" - elif self.occurrence =3D=3D OCCURRENCE__OPTIONAL_LIST: - return "/* optional, list */" + occurrence_map =3D { + OCCURRENCE__REQUIRED_ITEM: "/* required */", + OCCURRENCE__REQUIRED_LIST: "/* required, list */", + OCCURRENCE__OPTIONAL_ITEM: "/* optional */", + OCCURRENCE__OPTIONAL_LIST: "/* optional, list */" + } + try: + return occurrence_map[self.occurrence] + except KeyError: + raise ValueError("unknown occurrence value '%s'" % self.occurr= ence) =20 - raise ValueError("unknown occurrence value '%s'" % self.occurrence) =20 =20 =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 From nobody Tue Apr 30 02:56:49 2024 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 15215286067001000.9337257803415; Mon, 19 Mar 2018 23:50:06 -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 D524C61472; Tue, 20 Mar 2018 06:50:04 +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 9FA94BA7C; Tue, 20 Mar 2018 06:50:04 +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 60BD94CAAB; Tue, 20 Mar 2018 06:50:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6ncUF019441 for ; Tue, 20 Mar 2018 02:49:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id ADC555C70F; Tue, 20 Mar 2018 06:49:38 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A719EC5DAF for ; Tue, 20 Mar 2018 06:49:38 +0000 (UTC) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) (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 DDBA581DF6 for ; Tue, 20 Mar 2018 06:49:36 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id i189so270733wmf.0 for ; Mon, 19 Mar 2018 23:49:36 -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.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:34 -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=Qd5i+ECWLp1cEvBx1AtrF2lqtq4qaw3pnHJIOuq0TPU=; b=AMMuQfHSnJDqRJ8Jejun4/DBwLvw3BzUjvr/jgytOPmRFkvayROnwk5LvPF6xZXZxT 4jFf+UaLuSE1OJXz/HjTtcv5vTt88pqDYN3Mx5/Wby3iWxRbMYX1Kbpctjm+2fo3q9D+ BssbVmZCyQWd0B7zLQ6f3xZdy0Pm9q8GQyQalxuTIhaA6xOCWbB1tlha5agDQaWQ64kR hIJSsHSnP6MWKWdfZMOkYgnCvnGg0ylamnFbM8948uQ8OCKX1TUceBB8pQ8mvPOQRfzZ 7dQhcZ7R68mN9qgf4C7SUPNlgHKLdc/huGjy847emthCBqSG1bDn7OlFct+Z22lf2mrp 9WkA== 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=Qd5i+ECWLp1cEvBx1AtrF2lqtq4qaw3pnHJIOuq0TPU=; b=S6zF7ktlO6RgVQPr6LEsuZdarH6M44YdXiDpfu6RC2k/g6+9oBarRI9dz5YPCZiMLF 03cPyFjhObFnm2Uru4owPD99iYaw6RLi8PaLSZz2p9l2K4HKr/JtWc/nX4SswWo08CSA XVFIYQI6vlmKmJHkQF76T39lLlw9aFF20YorGdztYiOmYL2342wP1XuXBgiK5LTnoOHf +mw2hXC+RxIChNOreQpOjT0ix7ky0wsFe2x5G17cub/9C8TMkQbtIYPK0iHwWMDdF5P6 0CGXvlkLk1EqOemmgsAcf2bmvfaJUvOsEx+Oul3KaOdOXIRkU54rGc+BlnBcE3XuRx3b FvJA== X-Gm-Message-State: AElRT7Hbja414iQeeWgZf2iyn8s7BORCuAow4+F3Pu5SWYhSzTSbwT1K cw7EYNTv7G1YIx8IehcqV7r1E/1G X-Google-Smtp-Source: AG47ELvJnczAJa2uleCpfmFhENv7iVzOWj/xPCGrH5E4SHpVN9YKJwdYQeXNqppV2B9v8zkM5r8CDA== X-Received: by 10.28.234.207 with SMTP id g76mr1134287wmi.149.1521528575334; Mon, 19 Mar 2018 23:49:35 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:52 +0000 Message-Id: <20180320064908.17723-10-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.25]); Tue, 20 Mar 2018 06:49:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 20 Mar 2018 06:49:37 +0000 (UTC) for IP:'74.125.82.65' DOMAIN:'mail-wm0-f65.google.com' HELO:'mail-wm0-f65.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.65 mail-wm0-f65.google.com 74.125.82.65 mail-wm0-f65.google.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 09/25] cfg.mk: check ctype_macros only on *.[c|h] files 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.39]); Tue, 20 Mar 2018 06:50:05 +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" The functions like isalnum(), isalpha(), isdigit(), etc. are also available in Python, however `make syntax-check` do not intend to prohibit them. Signed-off-by: Radostin Stoyanov --- cfg.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/cfg.mk b/cfg.mk index bc8088d7c..4aa26d434 100644 --- a/cfg.mk +++ b/cfg.mk @@ -496,6 +496,7 @@ ctype_re =3D isalnum|isalpha|isascii|isblank|iscntrl|is= digit|isgraph|islower\ =20 sc_avoid_ctype_macros: @prohibit=3D'\b($(ctype_re)) *\(' \ + in_vc_files=3D'\.[ch]$$' \ halt=3D'use c-ctype.h instead of ctype macros' \ $(_sc_search_regexp) =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528609741766.1677242059693; Mon, 19 Mar 2018 23:50:09 -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 3195B81239; Tue, 20 Mar 2018 06:50:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 92874425F; Tue, 20 Mar 2018 06:50:07 +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 14559181BA02; Tue, 20 Mar 2018 06:50:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6neMQ019459 for ; Tue, 20 Mar 2018 02:49:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4077160BE3; Tue, 20 Mar 2018 06:49:40 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5C765FCA2 for ; Tue, 20 Mar 2018 06:49:39 +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 622D54DD49 for ; Tue, 20 Mar 2018 06:49:38 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id t6so1261802wmt.5 for ; Mon, 19 Mar 2018 23:49:38 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:35 -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=czUdeq3fSkBf22BfifeYiOz7vk3I//srSEd5ffGawLg=; b=J3BOAapCkPrzl5KOBKm/pGvTFV/RIj1kay4AmaRJqdBbVWLsxfVEoHw306bEiME1ao uxh+xkpnoii2M8zrA6j246C+lU1LH8y8ST7rbW0bx8nAKRg+uKiBdceVeNmwiF7BAEuE 2UQ9MUDsU68PANmiuIlH9iv5LRMPXeSdTU5SceHvmPV0H5KNoDHJIuQy2dPkZmzF0sw4 KkuM4qdOSHkrM8SMVRFqTDNdrH6bIJMj2xHGSBCGjlIOQ1Ahc29x5vv+OnS35/RGTKue 0w7KnUJs9XF6KvawJScxbn3qrsKGwuVQShhMnVaV6D4JXv1Bcc68KzLKSqktTzDf5dTU IYug== 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=czUdeq3fSkBf22BfifeYiOz7vk3I//srSEd5ffGawLg=; b=lJynO6Y4OdmGUkgFsxnNp4VcZiZSy77xzfDXgQE+XPm//k2Wi3yMauxlaHXFSs9Urf QuYZgn7rFVkYpZhj9hN11XjUFYA2V0ri5hU7QGilGODUirCO1yJgE8seJ04ydVq4R166 jgrcQX3nzTeuI4p+kH2mBFFEI+WaBDccEzJWa5agSojaWxTji38qBv1RXSHZcmiUPGgO 6R0Wxf0LyLn6Q1DQd7u90HrN/L6pK3jg4JtAT0Rw23hS1uRHgLlNrSUwY/ojsRWllXvS DoXYSS5M3KsBYSSDhW9TXwsfjtMyPLpNJtLfZTHGGKRw9Pvi8LwD0t8RbFiktTeqydwM 9nFA== X-Gm-Message-State: AElRT7HWY3hFvoJh+89SRO5iHol9qQca5CIzExTAPuwSVi93pHZGyDz6 VAsb8GmnWVXpwwhTTPGy7OXhABbA X-Google-Smtp-Source: AG47ELtO31bQmmvS6I2ZAfujMoCUuc0JxiNiUDXba0Ed3lrjg65SYZg/562dUhOFqsEGkqnzREUCjA== X-Received: by 10.28.173.8 with SMTP id w8mr1004089wme.18.1521528576701; Mon, 19 Mar 2018 23:49:36 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:53 +0000 Message-Id: <20180320064908.17723-11-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.38]); Tue, 20 Mar 2018 06:49:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 20 Mar 2018 06:49:38 +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.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 10/25] apibuild: Simplify conditional statements 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.25]); Tue, 20 Mar 2018 06:50:08 +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" Improve readability by reducing the complexity and length of conditional statements. Example: The following condition: if (o >=3D 97 and o <=3D 122) or (o >=3D 65 and o <=3D 90) or (o >=3D 48 and o <=3D 57) or (" \t(){}:;,+-*/%&!|[]=3D><".find(line[i]) =3D=3D -1): Will be True for every character that is not in string: " \t(){}:;,+-*/%&!|[]=3D><" Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 44 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index a11c2d145..51df9dc30 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -386,14 +386,13 @@ class index: def merge_public(self, idx): for id in idx.functions.keys(): if id in self.functions: + up =3D idx.functions[id] # check that function condition agrees with header - if idx.functions[id].conditionals !=3D \ - self.functions[id].conditionals: + if up.conditionals !=3D self.functions[id].conditionals: self.warning("Header condition differs from Function = for %s:" \ % id) self.warning(" H: %s" % self.functions[id].condition= als) - self.warning(" C: %s" % idx.functions[id].conditiona= ls) - up =3D idx.functions[id] + self.warning(" C: %s" % up.conditionals) self.functions[id].update(None, up.module, up.type, up.in= fo, up.extra) # else: # print("Function %s from %s is not declared in headers" = % ( @@ -515,7 +514,7 @@ class CLexer: self.last =3D ('string', tok) return self.last =20 - if l >=3D 2 and line[0] =3D=3D '/' and line[1] =3D=3D '*': + if line.startswith("/*"): line =3D line[2:] found =3D 0 tok =3D "" @@ -539,7 +538,7 @@ class CLexer: return None self.last =3D ('comment', tok) return self.last - if l >=3D 2 and line[0] =3D=3D '/' and line[1] =3D=3D '/': + if line.startswith("//"): line =3D line[2:] self.last =3D ('comment', line) return self.last @@ -564,28 +563,23 @@ class CLexer: if line[i] =3D=3D ' ' or line[i] =3D=3D '\t': i =3D i + 1 continue - o =3D ord(line[i]) - if (o >=3D 97 and o <=3D 122) or (o >=3D 65 and o <=3D 90)= or \ - (o >=3D 48 and o <=3D 57): + if line[i].isalnum(): s =3D i while i < l: - o =3D ord(line[i]) - if (o >=3D 97 and o <=3D 122) or (o >=3D 65 and o = <=3D 90) or \ - (o >=3D 48 and o <=3D 57) or \ - (" \t(){}:;,+-*/%&!|[]=3D><".find(line[i]) =3D= =3D -1): + if line[i] not in " \t(){}:;,+-*/%&!|[]=3D><": i =3D i + 1 else: break self.tokens.append(('name', line[s:i])) continue - if "(){}:;,[]".find(line[i]) !=3D -1: + if line[i] in "(){}:;,[]": # if line[i] =3D=3D '(' or line[i] =3D=3D ')' or line[i] = =3D=3D '{' or \ # line[i] =3D=3D '}' or line[i] =3D=3D ':' or line[i] = =3D=3D ';' or \ # line[i] =3D=3D ',' or line[i] =3D=3D '[' or line[i] = =3D=3D ']': self.tokens.append(('sep', line[i])) i =3D i + 1 continue - if "+-*><=3D/%&!|.".find(line[i]) !=3D -1: + if line[i] in "+-*><=3D/%&!|.": # if line[i] =3D=3D '+' or line[i] =3D=3D '-' or line[i] = =3D=3D '*' or \ # line[i] =3D=3D '>' or line[i] =3D=3D '<' or line[i] = =3D=3D '=3D' or \ # line[i] =3D=3D '/' or line[i] =3D=3D '%' or line[i] = =3D=3D '&' or \ @@ -597,8 +591,7 @@ class CLexer: continue =20 j =3D i + 1 - if j < l and ( - "+-*><=3D/%&!|".find(line[j]) !=3D -1): + if j < l and line[j] in "+-*><=3D/%&!|": # line[j] =3D=3D '+' or line[j] =3D=3D '-' or line[j= ] =3D=3D '*' or \ # line[j] =3D=3D '>' or line[j] =3D=3D '<' or line[j= ] =3D=3D '=3D' or \ # line[j] =3D=3D '/' or line[j] =3D=3D '%' or line[j= ] =3D=3D '&' or \ @@ -611,10 +604,7 @@ class CLexer: continue s =3D i while i < l: - o =3D ord(line[i]) - if (o >=3D 97 and o <=3D 122) or (o >=3D 65 and o <=3D= 90) or \ - (o >=3D 48 and o <=3D 57) or \ - (" \t(){}:;,+-*/%&!|[]=3D><".find(line[i]) =3D=3D -= 1): + if line[i] not in " \t(){}:;,+-*/%&!|[]=3D><": # line[i] !=3D ' ' and line[i] !=3D '\t' and # line[i] !=3D '(' and line[i] !=3D ')' and # line[i] !=3D '{' and line[i] !=3D '}' and @@ -1555,10 +1545,8 @@ class CParser: if token is None: return token =20 - while token[0] =3D=3D "name" and ( - token[1] =3D=3D "const" or \ - token[1] =3D=3D "unsigned" or \ - token[1] =3D=3D "signed"): + while (token[0] =3D=3D "name" and + token[1] in ["const", "unsigned", "signed"]): if self.type =3D=3D "": self.type =3D token[1] else: @@ -2402,8 +2390,7 @@ class docBuilder: pass typ =3D sorted(funcs.keys()) for type in typ: - if type =3D=3D '' or type =3D=3D 'void' or type =3D=3D "int" o= r \ - type =3D=3D "char *" or type =3D=3D "const char *": + if type in ['', "void", "int", "char *", "const char *"]: continue output.write(" \n" % (type)) ids =3D funcs[type] @@ -2431,8 +2418,7 @@ class docBuilder: pass typ =3D sorted(funcs.keys()) for type in typ: - if type =3D=3D '' or type =3D=3D 'void' or type =3D=3D "int" o= r \ - type =3D=3D "char *" or type =3D=3D "const char *": + if type in ['', "void", "int", "char *", "const char *"]: continue output.write(" \n" % (type)) ids =3D sorted(funcs[type]) --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528610081802.9322403700326; Mon, 19 Mar 2018 23:50:10 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 80556804F8; Tue, 20 Mar 2018 06:50:08 +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 49B9E5D731; Tue, 20 Mar 2018 06:50:08 +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 0A19E4CAAF; Tue, 20 Mar 2018 06:50:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6ngII019474 for ; Tue, 20 Mar 2018 02:49:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 209E05D962; Tue, 20 Mar 2018 06:49:42 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 19FD65DA62 for ; Tue, 20 Mar 2018 06:49:42 +0000 (UTC) Received: from mail-wr0-f182.google.com (mail-wr0-f182.google.com [209.85.128.182]) (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 2C11D23E6C9 for ; Tue, 20 Mar 2018 06:49:40 +0000 (UTC) Received: by mail-wr0-f182.google.com with SMTP id l8so463646wrg.5 for ; Mon, 19 Mar 2018 23:49:40 -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.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:37 -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=EQX8pYv40vKtvewHd77Py7mx5quF6wH4+X1Ar6adGG8=; b=e+TKyN5aKIHovWvU0ssp4Cz7TjoL4XGHRpcOUq9JkUjL/W4mbEfn8dGQ8hHb3A8TVR 69v7PQLpDt9OJMVLWGp5oeDZwQ50cg7B9IvZ3kBmtbyGAj9iPH6Y3K2yisI14HLofGhD p7BjeWPygU+QnxNMjgs2CRtRkBTBxRXFvVVCKKpZFPXESmlxx+ZFuXCUkPwYZ1DDFcHn nEi+6ALktVsThcymCEtgVzmUoFnqwF4RlPMTdgJjnae5LwhgZmKEhiW1Dj4S9jipaCpA O1GMZv4Cgd2xs9IsuHq1HjlnF5fTNQs4vSRzWCjaRLRcroPNXxs+B8rOZHYmEkDtztgs gb7Q== 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=EQX8pYv40vKtvewHd77Py7mx5quF6wH4+X1Ar6adGG8=; b=gedxp44lGG/UNPUgBBYuIhvZbh57rN8ZnFw04ryG3zZgxJBDKVx9BArkcOXYDjdmAs LHogPt2cIz6Vf7StVzve4bTEUxvRV0VQspM2J+u5depTd3xW/DsPoWzyl9VegPWHcIYM u9nGLquhBbeKSr4jPbyLGAR0InvNmBr4RhhULGtQdz72odJumB2V5hLekeMxzx2CLQwB /z2z2fGN4N1IPY3IltmyWeYdn3rpJOKGFwFrJXATXCKr7H6aGzhNVTz/dRoACVC6lBxt SNM6jNnVZWSJLVAexeQTOVaTymn/xGlHaswvkt0Vp+WdMiy9sW7j4bpuML2uCqPN0gk4 HeLw== X-Gm-Message-State: AElRT7H5YjedPPiHmlRwMCYAtj0f397rUzXY22jrdtno60kyQ1qHKtJy KEKKCyrLLAgc0twEeCk0XveOAdRI X-Google-Smtp-Source: AG47ELsi+vlCWWp0MvX/9G+LEQllE2sWA4T9L8cGaNt8nJ90pZFY0o+mBjkdL2g7QiTjX+K3wYnURg== X-Received: by 10.223.151.193 with SMTP id t1mr1500798wrb.206.1521528578396; Mon, 19 Mar 2018 23:49:38 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:54 +0000 Message-Id: <20180320064908.17723-12-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.29]); Tue, 20 Mar 2018 06:49:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 20 Mar 2018 06:49:40 +0000 (UTC) for IP:'209.85.128.182' DOMAIN:'mail-wr0-f182.google.com' HELO:'mail-wr0-f182.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.182 mail-wr0-f182.google.com 209.85.128.182 mail-wr0-f182.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 11/25] python: Remove space around = in keyword args 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 20 Mar 2018 06:50:09 +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" PEP8 recommends not having spaces around =3D in a keyword argument or a default parameter value. https://www.python.org/dev/peps/pep-0008/#other-recommendations Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 24 ++++++++++++------------ docs/index.py | 26 +++++++++++++------------- src/esx/esx_vi_generator.py | 4 ++-- tests/cputestdata/cpu-cpuid.py | 4 ++-- tests/cputestdata/cpu-reformat.py | 2 +- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 51df9dc30..50ddf372d 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -137,8 +137,8 @@ def uniq(items): return k =20 class identifier: - def __init__(self, name, header=3DNone, module=3DNone, type=3DNone, li= neno =3D 0, - info=3DNone, extra=3DNone, conditionals =3D None): + def __init__(self, name, header=3DNone, module=3DNone, type=3DNone, li= neno=3D0, + info=3DNone, extra=3DNone, conditionals=3DNone): self.name =3D name self.header =3D header self.module =3D module @@ -209,7 +209,7 @@ class identifier: def get_conditionals(self): return self.conditionals =20 - def update(self, header, module, type =3D None, info =3D None, extra= =3DNone, + def update(self, header, module, type=3DNone, info=3DNone, extra=3DNon= e, conditionals=3DNone): if self.name =3D=3D debugsym and not quiet: print("=3D> update %s : %s" % (debugsym, (module, type, info, @@ -228,7 +228,7 @@ class identifier: self.set_conditionals(conditionals) =20 class index: - def __init__(self, name =3D "noname"): + def __init__(self, name=3D"noname"): self.name =3D name self.identifiers =3D {} self.functions =3D {} @@ -247,7 +247,7 @@ class index: warnings =3D warnings + 1 print(msg) =20 - def add_ref(self, name, header, module, static, type, lineno, info=3DN= one, extra=3DNone, conditionals =3D None): + def add_ref(self, name, header, module, static, type, lineno, info=3DN= one, extra=3DNone, conditionals=3DNone): if name[0:2] =3D=3D '__': return None d =3D None @@ -269,7 +269,7 @@ class index: =20 return d =20 - def add(self, name, header, module, static, type, lineno, info=3DNone,= extra=3DNone, conditionals =3D None): + def add(self, name, header, module, static, type, lineno, info=3DNone,= extra=3DNone, conditionals=3DNone): if name[0:2] =3D=3D '__': return None d =3D None @@ -629,7 +629,7 @@ class CLexer: =20 class CParser: """The C module parser""" - def __init__(self, filename, idx =3D None): + def __init__(self, filename, idx=3DNone): self.filename =3D filename if len(filename) > 2 and filename[-2:] =3D=3D '.h': self.is_header =3D 1 @@ -661,7 +661,7 @@ class CParser: def lineno(self): return self.lexer.getlineno() =20 - def index_add(self, name, module, static, type, info=3DNone, extra =3D= None): + def index_add(self, name, module, static, type, info=3DNone, extra=3DN= one): if self.is_header =3D=3D 1: self.index.add(name, module, module, static, type, self.lineno= (), info, extra, self.conditionals) @@ -670,7 +670,7 @@ class CParser: info, extra, self.conditionals) =20 def index_add_ref(self, name, module, static, type, info=3DNone, - extra =3D None): + extra=3DNone): if self.is_header =3D=3D 1: self.index.add_ref(name, module, module, static, type, self.lineno(), info, extra, self.conditiona= ls) @@ -763,7 +763,7 @@ class CParser: # # Parse a comment block associate to a typedef # - def parseTypeComment(self, name, quiet =3D 0): + def parseTypeComment(self, name, quiet=3D0): if name[0:2] =3D=3D '__': quiet =3D 1 =20 @@ -808,7 +808,7 @@ class CParser: # # Parse a comment block associate to a macro # - def parseMacroComment(self, name, quiet =3D 0): + def parseMacroComment(self, name, quiet=3D0): global ignored_macros =20 if name[0:2] =3D=3D '__': @@ -885,7 +885,7 @@ class CParser: # parameters descriptions, finally returns a block as complete # as possible # - def mergeFunctionComment(self, name, description, quiet =3D 0): + def mergeFunctionComment(self, name, description, quiet=3D0): global ignored_functions =20 if name =3D=3D 'main': diff --git a/docs/index.py b/docs/index.py index 5224324b1..0d07ca4d0 100755 --- a/docs/index.py +++ b/docs/index.py @@ -144,7 +144,7 @@ def createTable(db, name): return -1 return ret =20 -def checkTables(db, verbose =3D 1): +def checkTables(db, verbose=3D1): global TABLES =20 if db is None: @@ -188,7 +188,7 @@ def checkTables(db, verbose =3D 1): pass return 0 =20 -def openMySQL(db=3D"libvir", passwd=3DNone, verbose =3D 1): +def openMySQL(db=3D"libvir", passwd=3DNone, verbose=3D1): global DB =20 if passwd is None: @@ -275,25 +275,25 @@ def updateSymbol(name, module, type, desc): =20 return ret =20 -def addFunction(name, module, desc =3D ""): +def addFunction(name, module, desc=3D""): return updateSymbol(name, module, 'function', desc) =20 -def addMacro(name, module, desc =3D ""): +def addMacro(name, module, desc=3D""): return updateSymbol(name, module, 'macro', desc) =20 -def addEnum(name, module, desc =3D ""): +def addEnum(name, module, desc=3D""): return updateSymbol(name, module, 'enum', desc) =20 -def addStruct(name, module, desc =3D ""): +def addStruct(name, module, desc=3D""): return updateSymbol(name, module, 'struct', desc) =20 -def addConst(name, module, desc =3D ""): +def addConst(name, module, desc=3D""): return updateSymbol(name, module, 'const', desc) =20 -def addType(name, module, desc =3D ""): +def addType(name, module, desc=3D""): return updateSymbol(name, module, 'type', desc) =20 -def addFunctype(name, module, desc =3D ""): +def addFunctype(name, module, desc=3D""): return updateSymbol(name, module, 'functype', desc) =20 def addPage(resource, title): @@ -1055,7 +1055,7 @@ def analyzeHTMLPages(): =20 import time =20 -def getXMLDateArchive(t =3D None): +def getXMLDateArchive(t=3DNone): if t is None: t =3D time.time() T =3D time.gmtime(t) @@ -1064,7 +1064,7 @@ def getXMLDateArchive(t =3D None): url =3D "http://www.redhat.com/archives/libvir-list/%d-%s/date.html" %= (year, month) return url =20 -def scanXMLMsgArchive(url, title, force =3D 0): +def scanXMLMsgArchive(url, title, force=3D0): if url is None or title is None: return 0 =20 @@ -1094,7 +1094,7 @@ def scanXMLMsgArchive(url, title, force =3D 0): =20 return 1 =20 -def scanXMLDateArchive(t =3D None, force =3D 0): +def scanXMLDateArchive(t=3DNone, force=3D0): global wordsDictArchive =20 wordsDictArchive =3D {} @@ -1138,7 +1138,7 @@ def scanXMLDateArchive(t =3D None, force =3D 0): # Main code: open the DB, the API XML and analyze it # # # ######################################################################### -def analyzeArchives(t =3D None, force =3D 0): +def analyzeArchives(t=3DNone, force=3D0): global wordsDictArchive =20 ret =3D scanXMLDateArchive(t, force) diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py index 31bd10fb1..28d440a6d 100755 --- a/src/esx/esx_vi_generator.py +++ b/src/esx/esx_vi_generator.py @@ -119,7 +119,7 @@ class Parameter(Member): return aligned(string, self.get_occurrence_comment() + "\n") =20 =20 - def generate_return(self, offset =3D 0, end_of_line =3D ";"): + def generate_return(self, offset=3D0, end_of_line=3D";"): if self.occurrence =3D=3D OCCURRENCE__IGNORED: raise ValueError("invalid function parameter occurrence value = '%s'" % self.occurrence) @@ -610,7 +610,7 @@ class Object(GenericObject): return source =20 =20 - def generate_deep_copy_code(self, add_banner =3D False): + def generate_deep_copy_code(self, add_banner=3DFalse): source =3D "" =20 if self.extends is not None: diff --git a/tests/cputestdata/cpu-cpuid.py b/tests/cputestdata/cpu-cpuid.py index 43c92731a..c45118512 100755 --- a/tests/cputestdata/cpu-cpuid.py +++ b/tests/cputestdata/cpu-cpuid.py @@ -343,12 +343,12 @@ def convert(path): with open(path, "w") as f: json.dump({"return": {"model": {"name": "base", "props": props}}, "id": "model-expansion"}, - f, indent =3D 2, separators =3D (',', ': ')) + f, indent=3D2, separators=3D(',', ': ')) f.write("\n") =20 for chunk in rest: f.write("\n") - json.dump(chunk, f, indent =3D 2, separators =3D (',', ': ')) + json.dump(chunk, f, indent=3D2, separators=3D(',', ': ')) f.write("\n") =20 =20 diff --git a/tests/cputestdata/cpu-reformat.py b/tests/cputestdata/cpu-refo= rmat.py index 999ef1698..33976e775 100755 --- a/tests/cputestdata/cpu-reformat.py +++ b/tests/cputestdata/cpu-reformat.py @@ -5,5 +5,5 @@ import json =20 dec =3D json.JSONDecoder() data, pos =3D dec.raw_decode(sys.stdin.read()) -json.dump(data, sys.stdout, indent =3D 2, separators =3D (',', ': ')) +json.dump(data, sys.stdout, indent=3D2, separators=3D(',', ': ')) print --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528611237342.8194829481341; Mon, 19 Mar 2018 23:50:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B82475D698; Tue, 20 Mar 2018 06:50:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B83B5D784; Tue, 20 Mar 2018 06:50:09 +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 48029181BA00; Tue, 20 Mar 2018 06:50:09 +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 w2K6ng2B019471 for ; Tue, 20 Mar 2018 02:49:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1544660A9E; Tue, 20 Mar 2018 06:49:42 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0DB12190D1 for ; Tue, 20 Mar 2018 06:49:42 +0000 (UTC) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) (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 3F4B1883A5 for ; Tue, 20 Mar 2018 06:49:41 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id h21so1206842wmd.1 for ; Mon, 19 Mar 2018 23:49:41 -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.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:38 -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=LzU7oAzL0b8iSrJYori2rTqjWsQRo4+JsSJpT1fjrrg=; b=gYmqkPLHrkCvSypnZkXNnzrhKcs+FT301zUzxdJs7EvqA36bJs7Gzsx+41MxWkDH3o +LKCuzJSYvdZ6+CvilxgjpK8xTYzG27gPg7vuUE8zl9k1M3/5z4Fcg4xSNspHOHFUtEP fK5v8S6jJ/8XxTFnUuMhOyewL6+mMOyajp1VhLXcRIVrBNdfsx5hkon7i5olL8poSBWj 75CC/80umX4IQLK4j27WMhuAiWrZ1f9d1Ccgjh8zxlwAf/0kGpGcv+oXx3XpZKJNepXp zOaoNb2F4NhVxmzyCe5whdsTUejGB4CAhxo+rdhGOfpzN79iWI3/STcfVAaD3iIou0rR Dvtw== 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=LzU7oAzL0b8iSrJYori2rTqjWsQRo4+JsSJpT1fjrrg=; b=k+TkCjiGZ3jEtmJkaarntOEsUJCxnh9jYsgqmBiXXE/BaWV9wZ7cSDlXnOwJHWKrtH av7lMX2qJvRoJVK1eeaD7blslmhKq49CdvMZuyPMR1GLY0UiGJNdU6bb8hXdenJpnA+h qjc7MRKklf1+l16BOt2I0LaQmLkPhl4Apprki5GSoHHEh+2ebhqbOFHdkNB0THR0jlY/ WKkXJCZ7nd9H05NT5Uf7cysgoKV79YUeF7SX5i43aidl3HMWs38Y0woM1vTil/4KepyK FcPoOX3AY0kMyZ4BcbUUs/lygydXXFOBBtvS/E3R5tmix23+O1SXDY2jzzGl9FqbKvaC VNsw== X-Gm-Message-State: AElRT7GlafUnXrSLwAFWKq2Y9tuxgl+ZyN744JthaQTBjA51lRD0f+Cj 5F+W3WDqLspldA4MaHs9ZjPsElDS X-Google-Smtp-Source: AG47ELunh2WNHjEJn5KjmQh1VY9yoyOuYsVvnYFzN2aZAPwQLuWeaA+ileZC2KgbpJ/tL+me+e3vCg== X-Received: by 10.28.149.197 with SMTP id x188mr978043wmd.87.1521528579642; Mon, 19 Mar 2018 23:49:39 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:55 +0000 Message-Id: <20180320064908.17723-13-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.26]); Tue, 20 Mar 2018 06:49:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 20 Mar 2018 06:49:41 +0000 (UTC) for IP:'74.125.82.68' DOMAIN:'mail-wm0-f68.google.com' HELO:'mail-wm0-f68.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.68 mail-wm0-f68.google.com 74.125.82.68 mail-wm0-f68.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 12/25] WmiClass: Don't share "versions" between instances 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 20 Mar 2018 06:50:10 +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" Lists in Python are mutable and when used as a default value of a parameter for class constructor, its value will be shared between all class instances. Example: class Test: def __init__(self, mylist=3D[]): self.mylist =3D mylist A =3D Test() B =3D Test() A.mylist.append("mylist from instance A") print(B.mylist) # Will print ['mylist from instance A'] Signed-off-by: Radostin Stoyanov --- src/hyperv/hyperv_wmi_generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_gen= erator.py index 6e98f0a89..0dcd9e438 100755 --- a/src/hyperv/hyperv_wmi_generator.py +++ b/src/hyperv/hyperv_wmi_generator.py @@ -44,9 +44,9 @@ class WmiClass: to. """ =20 - def __init__(self, name, versions =3D []): + def __init__(self, name, versions=3DNone): self.name =3D name - self.versions =3D versions + self.versions =3D versions if versions else list() self.common =3D None =20 =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528611602435.2152173727088; Mon, 19 Mar 2018 23:50:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4BEC0356DC; Tue, 20 Mar 2018 06:50:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 22AC018949; Tue, 20 Mar 2018 06:50:10 +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 D8438181BA06; Tue, 20 Mar 2018 06:50:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nhSB019489 for ; Tue, 20 Mar 2018 02:49:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id A9918D1E8; Tue, 20 Mar 2018 06:49:43 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A4C2CD1E4 for ; Tue, 20 Mar 2018 06:49:43 +0000 (UTC) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) (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 A9DF580F6C for ; Tue, 20 Mar 2018 06:49:42 +0000 (UTC) Received: by mail-wm0-f43.google.com with SMTP id h76so1194989wme.4 for ; Mon, 19 Mar 2018 23:49:42 -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.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:40 -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=OmSu/QO63Y+3hWAF5SFeLbUzTMB6CrTQW5lYVONENvk=; b=JPcCwvkMJSqoI87vn86gGUE7tYS6T+jpCHNLUlUpjK0rgBqzmNi6rxYvSz0TPklnM4 rGoz7tOnWJf8d5IqieU+c7O+g4Jk8wvA7GE7BT9vbb823cFS1LyQ1fm8Iznoteq2AfH0 0cFZVPAZwcr0+Byo0xGWEXu2xl5QG+XMSn3xmkvmtHCezT1Wf1m/622azPRp7iHgt4HF dSWwUiRtd5xjrIqEOwWCgfq4+ajjih4PiziwJkQpasf0O4UVYqTJ89ChcJrq5AukpRlM SUCbKNLK9xiqNou9Gh50I3WLNte7bQAeZzI1DNlYH0c25Q8fDAiEGhR46fG+I1I1wnyd dDsA== 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=OmSu/QO63Y+3hWAF5SFeLbUzTMB6CrTQW5lYVONENvk=; b=nzzpW+9QPh8iRKgewnqvmy4rMAC7HTeC/RvmbuNM854khoK0UF7Yba/cKbqh/upL2p zib3vAe+jBgtJZL7xERraxEbI3XfrL4I6UhCmx0r5F4cO04Mf4A6QumLR4EuW7pQn+M/ YR13lJvfREH6FFyRYgxbxJkAH0urXipbF2BGr26nf7CL2s082gYKAlogTdMqNzAT9vea c5tcNxpUsC4arVihPbujZ/6k10HornSpeK2ZeA5+pgjRY4I71Qz/zGmVoERNOB6FHQgi ne4r4PRhk3ezFYJYt/59EiKfMylN6e5r1FhpLVqVYbn2ZvymctewQbOov/I5etUEpx5M zDlw== X-Gm-Message-State: AElRT7HwuP0JiW89L6dDAzV9OrnbROdKddZ1EHtZy8HKqj9sq4G5w530 ErHrn4mOISXCqbyMY2mU+WffhJgW X-Google-Smtp-Source: AG47ELtdpJJrhPIG7jcII7py15PI9aRctg0aj1fRA4ok9tvdEYxFIsLJyWcRSAxwBchjnzfF6DEx1A== X-Received: by 10.28.8.143 with SMTP id 137mr1025735wmi.54.1521528581111; Mon, 19 Mar 2018 23:49:41 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:56 +0000 Message-Id: <20180320064908.17723-14-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.27]); Tue, 20 Mar 2018 06:49:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 20 Mar 2018 06:49:42 +0000 (UTC) for IP:'74.125.82.43' DOMAIN:'mail-wm0-f43.google.com' HELO:'mail-wm0-f43.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.43 mail-wm0-f43.google.com 74.125.82.43 mail-wm0-f43.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 13/25] apibuild: Simplify uniq 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 20 Mar 2018 06:50:10 +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" Use a set (unordered collections of unique elements) [1] to remove repeated elements in a list. 1: https://docs.python.org/3/tutorial/datastructures.html#sets Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 50ddf372d..1619c8836 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -130,11 +130,7 @@ def escape(raw): return raw =20 def uniq(items): - d =3D {} - for item in items: - d[item] =3D 1 - k =3D sorted(d.keys()) - return k + return sorted(set(items)) =20 class identifier: def __init__(self, name, header=3DNone, module=3DNone, type=3DNone, li= neno=3D0, --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528615432192.48118117498018; Mon, 19 Mar 2018 23:50:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B077E4E8B8; Tue, 20 Mar 2018 06:50:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7EA5E61353; Tue, 20 Mar 2018 06:50:13 +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 2C42D180BADA; Tue, 20 Mar 2018 06:50:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6njjw019499 for ; Tue, 20 Mar 2018 02:49:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1D0BAC5DA7; Tue, 20 Mar 2018 06:49:45 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 15F5A5C545 for ; Tue, 20 Mar 2018 06:49:45 +0000 (UTC) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) (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 235314E8B8 for ; Tue, 20 Mar 2018 06:49:44 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id f14so456695wre.8 for ; Mon, 19 Mar 2018 23:49:44 -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.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:41 -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=G9tw4Hw+WXWd+OxlPKiSZ5n8oFjcscQQgD32ewxSz88=; b=pNhvxmxTIWzah72Z5ccBXSKJrsyzhwJMZIW+SFQecXinFZ2GZoPBw13z+Syl1B1zEE eblfpm9KGQXtk5huKKYAGLRF3wZXFoFDNc6m56WougJM9JoYWPjzDBrIsJUl94pCYvcB 7vwhC6rV+XMRMmY7bMK+ztnrwfGpw9LhBwIRIfyvBgZpV5Vd3p6UhmTjmwIJDbjSQj7l zBz6YaWssv9RoFETEJo3BF/E9SkeIdxrT0D1Jg5g5qh8K6yn51Iv1Ih8rib3hvBBpaFI vMSdDIF2g/fy+Yzg/KOyE1/A1P34uwJHbn86dgVxtz1ObjeXzXzr05LxC0QEvW75Ze8R akzA== 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=G9tw4Hw+WXWd+OxlPKiSZ5n8oFjcscQQgD32ewxSz88=; b=dv80YresNzNbIpZQpsNZgCPPmyKVTC7dA0A8ECcqOuYqbnkXGXBaQ8djvOHYTyDF+B ZAkpocH74V14ywy/QiLt9DwmimwCUeKVN0ybblFCyQSS1Xp1Iqjpxi3C93RkeVv3rSpT xlTGl9+4NHOES+53gUaWsUY2kELSbZTjr1SuJWEk5kEfyDlApprK9e90xjRsA1rpuw6M 9egunjwxC4iZx1y6B4wSehgILsWKN8RPw5hTR48ZJ4bmzN4OIvmfq81ibMYJqpe6geyc 9Pt+oc1fZct3H4I9eLg7wP64FdrFBGu7ESgauCD84vy7KnEBvvcwh61Wrvb59c3IXfht 1Xlw== X-Gm-Message-State: AElRT7FvIzxi5ani4kMleIgnRPpDgxdFBB2WD14QF4TrQRQHHMx0HChh HQWdPoqs9+i7qSGLpQV+a2NheS7Q X-Google-Smtp-Source: AG47ELtywJAslNnJMLGblQqyfacrWNo+JwjazsmfdrTdpmrVjnewjAB7Za75tmFhJHuZv6tFBoIZnQ== X-Received: by 10.223.174.2 with SMTP id x2mr12513587wrc.211.1521528582528; Mon, 19 Mar 2018 23:49:42 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:57 +0000 Message-Id: <20180320064908.17723-15-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.38]); Tue, 20 Mar 2018 06:49:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 20 Mar 2018 06:49:44 +0000 (UTC) for IP:'209.85.128.196' DOMAIN:'mail-wr0-f196.google.com' HELO:'mail-wr0-f196.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.196 mail-wr0-f196.google.com 209.85.128.196 mail-wr0-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 14/25] apibuild: Avoid double sorting of ids 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 20 Mar 2018 06:50:14 +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" The uniq() function returns a sorted list, there is no need to sort this list again. Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 1619c8836..e5e4bc83d 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -2318,8 +2318,7 @@ class docBuilder: if desc.find("DEPRECATED") !=3D -1: output.write(" \n") =20 - ids =3D sorted(dict.macros.keys()) - for id in uniq(ids): + for id in uniq(dict.macros.keys()): # Macros are sometime used to masquerade other types. if id in dict.functions: continue @@ -2334,20 +2333,15 @@ class docBuilder: if id in dict.enums: continue output.write(" \n" = % (id)) - ids =3D sorted(dict.enums.keys()) - for id in uniq(ids): + for id in uniq(dict.enums.keys()): output.write(" \n" %= (id)) - ids =3D sorted(dict.typedefs.keys()) - for id in uniq(ids): + for id in uniq(dict.typedefs.keys()): output.write(" \n= " % (id)) - ids =3D sorted(dict.structs.keys()) - for id in uniq(ids): + for id in uniq(dict.structs.keys()): output.write(" \n"= % (id)) - ids =3D sorted(dict.variables.keys()) - for id in uniq(ids): + for id in uniq(dict.variables.keys()): output.write(" \= n" % (id)) - ids =3D sorted(dict.functions.keys()) - for id in uniq(ids): + for id in uniq(dict.functions.keys()): output.write(" \= n" % (id)) output.write(" \n") =20 @@ -2363,7 +2357,6 @@ class docBuilder: list(dict.typedefs.keys()) + \ list(dict.structs.keys()) + \ list(dict.enums.keys())) - ids.sort() for id in ids: output.write(" \n" % (id)) output.write(" \n") --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528618421279.7958629811128; Mon, 19 Mar 2018 23:50:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C80981E04; Tue, 20 Mar 2018 06:50:17 +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 C9908C5DAE; Tue, 20 Mar 2018 06:50:16 +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 7FF694CAB6; Tue, 20 Mar 2018 06:50:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nnaT019530 for ; Tue, 20 Mar 2018 02:49:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 28F435D6B7; Tue, 20 Mar 2018 06:49:49 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 235235D6A8 for ; Tue, 20 Mar 2018 06:49:46 +0000 (UTC) Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) (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 C48544E8B8 for ; Tue, 20 Mar 2018 06:49:45 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id s10so455187wra.13 for ; Mon, 19 Mar 2018 23:49:45 -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.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:43 -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=3oa30uuJqgK/pk+Itep0ceI9gMuMz2YcZISsxX5yX+k=; b=S3I2rXlvEYUeJnewF01cSRCuhzeCwr/yxNqwyXtQOCOau367bK6kkgGR+1PgTLDB5I AhLDO38EbbaSWTi1gi5Qp6M8sc0swramdtSdfv4SOIJIbRiXKdHvoE6HLY+Q+tX5aLPl t7MaFabCpUkPc+aTLwgnFIGgMJzSXvvVQ+QQJgJdVRnmnHe+eIDA1MJl/gOYXrm3BSV+ gGienr2+i1izESmRlmTFlrUorQK8BSwvpesABU8+s+/5v0yD+yPtan5/ZkmYbtdCvi3M h3TkUXn0CT0XdibXiDlJjQ6zVDP8akeVGWKjEz486hpxbCbd1PL1uJbk/bepbptVtqs7 XVLA== 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=3oa30uuJqgK/pk+Itep0ceI9gMuMz2YcZISsxX5yX+k=; b=V+AgJn1MDi4NurKfbfw36bF1IMKnnbKRSKXsAOWccw8JRYkRWUdypTrhBcpRBMKMSu OS9xskMeqbZSqhfL1FXN1eKTILVgFErli8ar5RADYCHfdT64EG+KbB0bDfDHEK29ueuA gTuaqK6Jjjia8s/FdJRWT44UbOnTQnq92d9OhQjOm8/ObhIdZV2H1KHBq14Th8Y+Go7+ Bj72oP1xUEo88NumPYaqJngYZukGpTeQ2jnJC4uTcWjzll+h/sbBmtX8ndYrGELMl9o8 Z+OKpmbUqWTKcuLrH2KpN6Ayq3NUyjJkzowKEBhw0mZ6wJNBTxL5M3uEKSmQn2kGrcNt t9Xw== X-Gm-Message-State: AElRT7H0xfmTG+MCpWGWQwgO6nqyQ28xE+CyXN6A12kArhsPNc6pAMMS IsrmMD3wWu+4ZSd5/89Yez6pydAn X-Google-Smtp-Source: AG47ELuJ9URpYWcp42AwCbvWArU8oT2gOxLH+wvBluOpuFcLFdF51ETsygPHLFKWr8iaAkEOdMczqw== X-Received: by 10.223.158.196 with SMTP id b4mr11492427wrf.112.1521528584060; Mon, 19 Mar 2018 23:49:44 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:58 +0000 Message-Id: <20180320064908.17723-16-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.38]); Tue, 20 Mar 2018 06:49:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 20 Mar 2018 06:49:45 +0000 (UTC) for IP:'209.85.128.194' DOMAIN:'mail-wr0-f194.google.com' HELO:'mail-wr0-f194.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.194 mail-wr0-f194.google.com 209.85.128.194 mail-wr0-f194.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 15/25] python3: cpu-reformat: Use the print() 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 20 Mar 2018 06:50:17 +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" Replace the print statement, that is only available in Py2, with a print function that is available in both Py2 and Py3 and drop the explicit python version in the shebang. Signed-off-by: Radostin Stoyanov --- tests/cputestdata/cpu-reformat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cputestdata/cpu-reformat.py b/tests/cputestdata/cpu-refo= rmat.py index 33976e775..d4ed8d811 100755 --- a/tests/cputestdata/cpu-reformat.py +++ b/tests/cputestdata/cpu-reformat.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python =20 import sys import json @@ -6,4 +6,4 @@ import json dec =3D json.JSONDecoder() data, pos =3D dec.raw_decode(sys.stdin.read()) json.dump(data, sys.stdout, indent=3D2, separators=3D(',', ': ')) -print +print("\n") --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528615278374.02343309232765; Mon, 19 Mar 2018 23:50:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A30D361BB4; Tue, 20 Mar 2018 06:50:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 743635D78F; Tue, 20 Mar 2018 06:50:13 +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 2A239180BAD9; Tue, 20 Mar 2018 06:50:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nmXZ019523 for ; Tue, 20 Mar 2018 02:49:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id A5BC14251; Tue, 20 Mar 2018 06:49:48 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0E3CD1E4 for ; Tue, 20 Mar 2018 06:49:48 +0000 (UTC) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) (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 1C09D23E6F4 for ; Tue, 20 Mar 2018 06:49:47 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id x82so1276318wmg.1 for ; Mon, 19 Mar 2018 23:49:47 -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.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:44 -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=OSn+5+jz30ePcg2ZPbdvpqGJ1KeWtcJeUQEKgD7rrto=; b=RKgr+Ip9FfalFr5Tg48Du8547inYdNaNetM7yVdpPkWNa8UhhgW4vBJE0NsNko4jyp DYq/zzH9WfASus/ryhkkdYHkWP8zl9MUO0nQh/QL6pxFPwcRbaC+8uXJQ5biidfPSD9S ZF2Fhm2+wdToHnb0HecB2EV7FSwaxL3vENoYsFOpRIoDST87Krazif3nZw1o+PGrxx9i ztU1ZZER5vpcUTQU9RwUsWA2K4IAdMMyXGAaRVzf3q1kKKPL0M+Xo2ya4vKyQuOtCEw8 EnBQLVR6wUGJqcujixa1lppRr/6UWW2szCcOPgPLxHe6DKwiWlDx2tOPf+L+crwUto5Y MhtA== 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=OSn+5+jz30ePcg2ZPbdvpqGJ1KeWtcJeUQEKgD7rrto=; b=ir/szcZkhlwcOQLZP3nfuuYTGqfdeJhd/8R8QkHWDT5XVYa9sTgbUwFdXBcA+8uLd8 YrZ+GcKQ7yGJeALveFuQrimHWHvmkh00nDpdsT+Y/+8Pn1bp65vCVj/Ui3fBd+sqF+2c QHtehksyIZRrgkpNhCkJA0PTUm4+7mmEoHrj7S/F5T2v2wTV3G+Lty1Q+9q6KA0ez5O0 twnfgJrRf8Pyjkx66xYJ4CqW01d7ZTc47aRT2D9CuYIM5Wa0rtKj1XX0mQmQnug+xJH3 7bGV8JIUD/NQpKwwSJQbgXc048IXTIZGUvKck/XHcNU1lyhgIMN/XoxgLLHXZVbXSXHM h0UA== X-Gm-Message-State: AElRT7Egmw6gZp7VpgLMED8MALtlC4tlnuUfqMsg7Lcyneszqt2ExiE7 L+JxM5uzonoL+ma8wvInWoxe77ck X-Google-Smtp-Source: AG47ELsBAwoKjs29wSB71AutX7iXKiWuQUsi3URsc1bchdr8MeVRF8irDjwUyWbemP55u/RdZM4liQ== X-Received: by 10.28.144.134 with SMTP id s128mr527416wmd.4.1521528585512; Mon, 19 Mar 2018 23:49:45 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:59 +0000 Message-Id: <20180320064908.17723-17-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.29]); Tue, 20 Mar 2018 06:49:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 20 Mar 2018 06:49:47 +0000 (UTC) for IP:'74.125.82.65' DOMAIN:'mail-wm0-f65.google.com' HELO:'mail-wm0-f65.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.65 mail-wm0-f65.google.com 74.125.82.65 mail-wm0-f65.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 16/25] apibuild: Drop backslash between brackets 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 20 Mar 2018 06:50:14 +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" Backslash between brackets in Python is redundant. [1] 1: https://lintlyci.github.io/Flake8Rules/rules/E502.html Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index e5e4bc83d..acfbcafb2 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -385,8 +385,8 @@ class index: up =3D idx.functions[id] # check that function condition agrees with header if up.conditionals !=3D self.functions[id].conditionals: - self.warning("Header condition differs from Function = for %s:" \ - % id) + self.warning("Header condition differs from Function" + " for %s:" % id) self.warning(" H: %s" % self.functions[id].condition= als) self.warning(" C: %s" % up.conditionals) self.functions[id].update(None, up.module, up.type, up.in= fo, up.extra) @@ -1882,7 +1882,7 @@ class CParser: raise Exception() except: self.error(("struct '%s' is not allowed to contain lon= g " - "field '%s', use long long instead") \ + "field '%s', use long long instead") % (name, field[1])) =20 # @@ -1939,8 +1939,8 @@ class CParser: if token[1] =3D=3D "[": type =3D type + token[1] token =3D self.token() - while token is not None and (token[0] !=3D "sep" or \ - token[1] !=3D ";"): + while token is not None and (token[0] !=3D "sep" or + token[1] !=3D ";"): type =3D type + token[1] token =3D self.token() =20 @@ -1954,9 +1954,9 @@ class CParser: token =3D self.parseBlock(token) else: self.comment =3D None - while token is not None and (token[0] !=3D "sep" or \ - (token[1] !=3D ';' and token[1] !=3D ',')): - token =3D self.token() + while token is not None and (token[0] !=3D "sep" or + token[1] not in ',;'): + token =3D self.token() self.comment =3D None if token is None or token[0] !=3D "sep" or (token[1] !=3D = ';' and token[1] !=3D ','): @@ -2351,11 +2351,11 @@ class docBuilder: module =3D self.modulename_file(file) output.write(" \n" % (module)) dict =3D self.headers[file] - ids =3D uniq(list(dict.functions.keys()) + \ - list(dict.variables.keys()) + \ - list(dict.macros.keys()) + \ - list(dict.typedefs.keys()) + \ - list(dict.structs.keys()) + \ + ids =3D uniq(list(dict.functions.keys()) + + list(dict.variables.keys()) + + list(dict.macros.keys()) + + list(dict.typedefs.keys()) + + list(dict.structs.keys()) + list(dict.enums.keys())) for id in ids: output.write(" \n" % (id)) --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528612906457.1775285322698; Mon, 19 Mar 2018 23:50:12 -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 94E25356E6; Tue, 20 Mar 2018 06:50:11 +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 5E8075FCA2; Tue, 20 Mar 2018 06:50:11 +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 210C64CAB4; Tue, 20 Mar 2018 06:50:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nsvF019550 for ; Tue, 20 Mar 2018 02:49:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 263EA5DA62; Tue, 20 Mar 2018 06:49:54 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1FCD95D962 for ; Tue, 20 Mar 2018 06:49:51 +0000 (UTC) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) (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 182A3C057FA2 for ; Tue, 20 Mar 2018 06:49:49 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id d10so467786wrf.3 for ; Mon, 19 Mar 2018 23:49:49 -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.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:46 -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=GFAbTMkdOEeiovcpP3u+THvSjHqi2xZo5Brw9oHcOPo=; b=V+KLlq05bZVwHy6tLXoWNGmEaSEHb+Z8FQ1j4PU7FG9V5JBb8Dxa74eKmxzVUt9swx O8qCOJWGBlhRNie2lJPWih09WPFe1r9A9LQTHqnhrFM9sZ+CrXJ962Yxzw22rYD56vQI 8rHr73PPTxKe/uKnTnqpOP0IlfEBSNe3R+ZVIn9SCaWVsRriGA7KYzQ3Dj97yQmduFNX rGdJKjOB1jyJh31mnEu3vPY+6VdTow6V+lrQbIDnbEuEcl6SmXEL73xBOZ+iW62dEv06 sb4v5CFM37BYBDMHrjsXCQFkwC9AcSDY3Dq0y3yalqaTC1wykrCIVF2b+rmv1r4+Q+u5 aTGA== 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=GFAbTMkdOEeiovcpP3u+THvSjHqi2xZo5Brw9oHcOPo=; b=HZ1vIsuenif2QOZLk1DiTRzz+ip1wLwmtDJjk7p7Y0HpWtCWn2PCJcgpAtgeIwCUZF wZ2Rztvlr0sgZfP9SecE9ARO5sJ3x7jUpmlBBbO/7ePeLpPu9TAuV80X/bfL8T5B4nzQ Az2SJ1OByHlLMNA9xYFlXzk1lkF2sxbSe3JwULA4oYoBBe3muyegdFiJE3bdc4fzM95w 1qiiXBj6SdIK95KnVftUg+U3PehJGIT9HK6hKyXtKCYmdDJyIlj+YV0gL9hLRkwEasdd DzIhPVCmAwsvKNP22fqLjSebbFSUUnj25Z5tVB2mOQu/lShhDq6K+1e5lv5a5J3ygr/F DIqA== X-Gm-Message-State: AElRT7GQ0gSSV4oxBfgN/1QwbEA8pMwDQB93HynBufvwPz+6V4GHTKPG 7bZGp5sDzbmB9TcDUIQViEOP8qGt X-Google-Smtp-Source: AG47ELuu7b7NyAbLSe8weZ3shjS3gtMhUmOTxY8NDhnN1d8DNoECjkmatyiZNW2qB+FgYoXf8HGA+g== X-Received: by 10.223.188.1 with SMTP id s1mr12329151wrg.243.1521528587173; Mon, 19 Mar 2018 23:49:47 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:49:00 +0000 Message-Id: <20180320064908.17723-18-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.32]); Tue, 20 Mar 2018 06:49:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 20 Mar 2018 06:49:49 +0000 (UTC) for IP:'209.85.128.193' DOMAIN:'mail-wr0-f193.google.com' HELO:'mail-wr0-f193.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.149 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS, T_FILL_THIS_FORM_SHORT) 209.85.128.193 mail-wr0-f193.google.com 209.85.128.193 mail-wr0-f193.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 17/25] apibuild: Fix indentation not multiple of 4 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.30]); Tue, 20 Mar 2018 06:50:12 +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" PEP8 recommends that the number of spaces used for indentation of Python code to be a multiple of four [1] [2]. 1: https://lintlyci.github.io/Flake8Rules/rules/E111.html 2: https://lintlyci.github.io/Flake8Rules/rules/E114.html Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 296 ++++++++++++++++++++++++++++-----------------------= ---- 1 file changed, 150 insertions(+), 146 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index acfbcafb2..90d944ccf 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -248,11 +248,12 @@ class index: return None d =3D None try: - d =3D self.identifiers[name] - d.update(header, module, type, lineno, info, extra, conditional= s) + d =3D self.identifiers[name] + d.update(header, module, type, lineno, info, extra, conditiona= ls) except: - d =3D identifier(name, header, module, type, lineno, info, extr= a, conditionals) - self.identifiers[name] =3D d + d =3D identifier(name, header, module, type, lineno, info, ext= ra, + conditionals) + self.identifiers[name] =3D d =20 if d is not None and static =3D=3D 1: d.set_static(1) @@ -265,16 +266,18 @@ class index: =20 return d =20 - def add(self, name, header, module, static, type, lineno, info=3DNone,= extra=3DNone, conditionals=3DNone): + def add(self, name, header, module, static, type, lineno, info=3DNone, + extra=3DNone, conditionals=3DNone): if name[0:2] =3D=3D '__': return None d =3D None try: - d =3D self.identifiers[name] - d.update(header, module, type, lineno, info, extra, conditional= s) + d =3D self.identifiers[name] + d.update(header, module, type, lineno, info, extra, conditiona= ls) except: - d =3D identifier(name, header, module, type, lineno, info, extr= a, conditionals) - self.identifiers[name] =3D d + d =3D identifier(name, header, module, type, lineno, info, ext= ra, + conditionals) + self.identifiers[name] =3D d =20 if d is not None and static =3D=3D 1: d.set_static(1) @@ -308,92 +311,93 @@ class index: =20 def merge(self, idx): for id in idx.functions.keys(): - # - # macro might be used to override functions or variables - # definitions - # - if id in self.macros: - del self.macros[id] - if id in self.functions: - self.warning("function %s from %s redeclared in %s" % ( + # + # macro might be used to override functions or variables + # definitions + # + if id in self.macros: + del self.macros[id] + if id in self.functions: + self.warning("function %s from %s redeclared in %s" % ( id, self.functions[id].header, idx.functions[id].heade= r)) - else: - self.functions[id] =3D idx.functions[id] - self.identifiers[id] =3D idx.functions[id] + else: + self.functions[id] =3D idx.functions[id] + self.identifiers[id] =3D idx.functions[id] for id in idx.variables.keys(): - # - # macro might be used to override functions or variables - # definitions - # - if id in self.macros: - del self.macros[id] - if id in self.variables: - self.warning("variable %s from %s redeclared in %s" % ( + # + # macro might be used to override functions or variables + # definitions + # + if id in self.macros: + del self.macros[id] + if id in self.variables: + self.warning("variable %s from %s redeclared in %s" % ( id, self.variables[id].header, idx.variables[id].heade= r)) - else: - self.variables[id] =3D idx.variables[id] - self.identifiers[id] =3D idx.variables[id] + else: + self.variables[id] =3D idx.variables[id] + self.identifiers[id] =3D idx.variables[id] for id in idx.structs.keys(): - if id in self.structs: - self.warning("struct %s from %s redeclared in %s" % ( + if id in self.structs: + self.warning("struct %s from %s redeclared in %s" % ( id, self.structs[id].header, idx.structs[id].header)) - else: - self.structs[id] =3D idx.structs[id] - self.identifiers[id] =3D idx.structs[id] + else: + self.structs[id] =3D idx.structs[id] + self.identifiers[id] =3D idx.structs[id] for id in idx.unions.keys(): - if id in self.unions: - print("union %s from %s redeclared in %s" % ( + if id in self.unions: + print("union %s from %s redeclared in %s" % ( id, self.unions[id].header, idx.unions[id].header)) - else: - self.unions[id] =3D idx.unions[id] - self.identifiers[id] =3D idx.unions[id] + else: + self.unions[id] =3D idx.unions[id] + self.identifiers[id] =3D idx.unions[id] for id in idx.typedefs.keys(): - if id in self.typedefs: - self.warning("typedef %s from %s redeclared in %s" % ( + if id in self.typedefs: + self.warning("typedef %s from %s redeclared in %s" % ( id, self.typedefs[id].header, idx.typedefs[id].header)) - else: - self.typedefs[id] =3D idx.typedefs[id] - self.identifiers[id] =3D idx.typedefs[id] + else: + self.typedefs[id] =3D idx.typedefs[id] + self.identifiers[id] =3D idx.typedefs[id] for id in idx.macros.keys(): - # - # macro might be used to override functions or variables - # definitions - # - if id in self.variables: - continue - if id in self.functions: - continue - if id in self.enums: - continue - if id in self.macros: - self.warning("macro %s from %s redeclared in %s" % ( + # + # macro might be used to override functions or variables + # definitions + # + if id in self.variables: + continue + if id in self.functions: + continue + if id in self.enums: + continue + if id in self.macros: + self.warning("macro %s from %s redeclared in %s" % ( id, self.macros[id].header, idx.macros[id].header)) - else: - self.macros[id] =3D idx.macros[id] - self.identifiers[id] =3D idx.macros[id] + else: + self.macros[id] =3D idx.macros[id] + self.identifiers[id] =3D idx.macros[id] for id in idx.enums.keys(): - if id in self.enums: - self.warning("enum %s from %s redeclared in %s" % ( + if id in self.enums: + self.warning("enum %s from %s redeclared in %s" % ( id, self.enums[id].header, idx.enums[id].header)) - else: - self.enums[id] =3D idx.enums[id] - self.identifiers[id] =3D idx.enums[id] + else: + self.enums[id] =3D idx.enums[id] + self.identifiers[id] =3D idx.enums[id] =20 def merge_public(self, idx): for id in idx.functions.keys(): - if id in self.functions: - up =3D idx.functions[id] - # check that function condition agrees with header - if up.conditionals !=3D self.functions[id].conditionals: - self.warning("Header condition differs from Function" - " for %s:" % id) - self.warning(" H: %s" % self.functions[id].condition= als) - self.warning(" C: %s" % up.conditionals) - self.functions[id].update(None, up.module, up.type, up.in= fo, up.extra) - # else: - # print("Function %s from %s is not declared in headers" = % ( - # id, idx.functions[id].module)) - # TODO: do the same for variables. + if id in self.functions: + up =3D idx.functions[id] + # check that function condition agrees with header + if up.conditionals !=3D self.functions[id].conditionals: + self.warning("Header condition differs from Function" + " for %s:" % id) + self.warning(" H: %s" % self.functions[id].conditiona= ls) + self.warning(" C: %s" % up.conditionals) + self.functions[id].update(None, up.module, up.type, up.inf= o, + up.extra) + # else: + # print("Function %s from %s is not declared in headers" %= ( + # id, idx.functions[id].module)) + # TODO: do the same for variables. =20 def analyze_dict(self, type, dict): count =3D 0 @@ -725,7 +729,7 @@ class CParser: elif line[i] =3D=3D '*': return line[:i] + line[i + 1:] else: - return line + return line return line =20 def cleanupComment(self): @@ -876,11 +880,11 @@ class CParser: =20 return((args, desc)) =20 - # - # Parse a comment block and merge the information found in the - # parameters descriptions, finally returns a block as complete - # as possible - # + # + # Parse a comment block and merge the information found in the + # parameters descriptions, finally returns a block as complete + # as possible + # def mergeFunctionComment(self, name, description, quiet=3D0): global ignored_functions =20 @@ -988,9 +992,9 @@ class CParser: desc =3D desc.strip() =20 if quiet =3D=3D 0: - # - # report missing comments - # + # + # report missing comments + # i =3D 0 while i < nbargs: if args[i][2] is None and args[i][0] !=3D "void" and args[= i][1] is not None: @@ -1022,7 +1026,7 @@ class CParser: if token is None: return None if token[0] =3D=3D 'preproc': - # TODO macros with arguments + # TODO macros with arguments name =3D token[1] lst =3D [] token =3D self.lexer.token() @@ -1107,11 +1111,11 @@ class CParser: token =3D self.lexer.token() return token =20 - # - # token acquisition on top of the lexer, it handle internally - # preprocessor and comments since they are logically not part of - # the program structure. - # + # + # token acquisition on top of the lexer, it handle internally + # preprocessor and comments since they are logically not part of + # the program structure. + # def push(self, tok): self.lexer.push(tok) =20 @@ -1148,9 +1152,9 @@ class CParser: return token return None =20 - # - # Parse a typedef, it records the type and its name. - # + # + # Parse a typedef, it records the type and its name. + # def parseTypedef(self, token): if token is None: return None @@ -1160,7 +1164,7 @@ class CParser: return None base_type =3D self.type type =3D base_type - #self.debug("end typedef type", token) + # self.debug("end typedef type", token) while token is not None: if token[0] =3D=3D "name": name =3D token[1] @@ -1185,7 +1189,7 @@ class CParser: else: self.error("parsing typedef: expecting a name") return token - #self.debug("end typedef", token) + # self.debug("end typedef", token) if token is not None and token[0] =3D=3D 'sep' and token[1] = =3D=3D ',': type =3D base_type token =3D self.token() @@ -1203,10 +1207,10 @@ class CParser: token =3D self.token() return token =20 - # - # Parse a C code block, used for functions it parse till - # the balancing } included - # + # + # Parse a C code block, used for functions it parse till + # the balancing } included + # def parseBlock(self, token): while token is not None: if token[0] =3D=3D "sep" and token[1] =3D=3D "{": @@ -1242,27 +1246,27 @@ class CParser: token =3D self.token() return token =20 - # - # Parse a C struct definition till the balancing } - # + # + # Parse a C struct definition till the balancing } + # def parseStruct(self, token): fields =3D [] - #self.debug("start parseStruct", token) + # self.debug("start parseStruct", token) while token is not None: if token[0] =3D=3D "sep" and token[1] =3D=3D "{": token =3D self.token() token =3D self.parseTypeBlock(token) elif token[0] =3D=3D "sep" and token[1] =3D=3D "}": self.struct_fields =3D fields - #self.debug("end parseStruct", token) - #print(fields) + # self.debug("end parseStruct", token) + # print(fields) token =3D self.token() return token else: base_type =3D self.type - #self.debug("before parseType", token) + # self.debug("before parseType", token) token =3D self.parseType(token) - #self.debug("after parseType", token) + # self.debug("after parseType", token) if token is not None and token[0] =3D=3D "name": fname =3D token[1] token =3D self.token() @@ -1293,13 +1297,13 @@ class CParser: token =3D self.token() self.type =3D base_type self.struct_fields =3D fields - #self.debug("end parseStruct", token) - #print(fields) + # self.debug("end parseStruct", token) + # print(fields) return token =20 - # - # Parse a C union definition till the balancing } - # + # + # Parse a C union definition till the balancing } + # def parseUnion(self, token): fields =3D [] # self.debug("start parseUnion", token) @@ -1347,9 +1351,9 @@ class CParser: # print(fields) return token =20 - # - # Parse a C enum block, parse till the balancing } - # + # + # Parse a C enum block, parse till the balancing } + # def parseEnumBlock(self, token): self.enums =3D [] name =3D None @@ -1512,10 +1516,10 @@ class CParser: =20 return token =20 - # - # Parse a C definition block, used for structs or unions it parse till - # the balancing } - # + # + # Parse a C definition block, used for structs or unions it parse till + # the balancing } + # def parseTypeBlock(self, token): while token is not None: if token[0] =3D=3D "sep" and token[1] =3D=3D "{": @@ -1528,11 +1532,11 @@ class CParser: token =3D self.token() return token =20 - # - # Parse a type: the fact that the type name can either occur after - # the definition or within the definition makes it a little harder - # if inside, the name token is pushed back before returning - # + # + # Parse a type: the fact that the type name can either occur after + # the definition or within the definition makes it a little harder + # if inside, the name token is pushed back before returning + # def parseType(self, token): self.type =3D "" self.struct_fields =3D [] @@ -1710,9 +1714,9 @@ class CParser: self.type =3D self.type + " " + token[1] token =3D self.token() =20 - # - # if there is a parenthesis here, this means a function type - # + # + # if there is a parenthesis here, this means a function type + # if token is not None and token[0] =3D=3D "sep" and token[1] =3D=3D= '(': self.type =3D self.type + token[1] token =3D self.token() @@ -1743,9 +1747,9 @@ class CParser: token =3D nametok return token =20 - # - # do some lookahead for arrays - # + # + # do some lookahead for arrays + # if token is not None and token[0] =3D=3D "name": nametok =3D token token =3D self.token() @@ -1765,7 +1769,7 @@ class CParser: self.error("parsing array type, ']' expected", token) return token elif token is not None and token[0] =3D=3D "sep" and token[1] = =3D=3D ':': - # remove :12 in case it's a limited int size + # remove :12 in case it's a limited int size token =3D self.token() token =3D self.token() self.lexer.push(token) @@ -1773,9 +1777,9 @@ class CParser: =20 return token =20 - # - # Parse a signature: '(' has been parsed and we scan the type definit= ion - # up to the ')' included + # + # Parse a signature: '(' has been parsed and we scan the type definiti= on + # up to the ')' included def parseSignature(self, token): signature =3D [] if token is not None and token[0] =3D=3D "sep" and token[1] =3D=3D= ')': @@ -1791,7 +1795,7 @@ class CParser: token =3D self.token() continue elif token is not None and token[0] =3D=3D "sep" and token[1] = =3D=3D ')': - # only the type was provided + # only the type was provided if self.type =3D=3D "...": signature.append((self.type, "...", None)) else: @@ -1885,10 +1889,10 @@ class CParser: "field '%s', use long long instead") % (name, field[1])) =20 - # - # Parse a global definition, be it a type, variable or function - # the extern "C" blocks are a bit nasty and require it to recurse. - # + # + # Parse a global definition, be it a type, variable or function + # the extern "C" blocks are a bit nasty and require it to recurse. + # def parseGlobal(self, token): static =3D 0 if token[1] =3D=3D 'extern': @@ -1945,9 +1949,9 @@ class CParser: token =3D self.token() =20 if token is not None and token[0] =3D=3D "op" and token[1] =3D= =3D "=3D": - # - # Skip the initialization of the variable - # + # + # Skip the initialization of the variable + # token =3D self.token() if token[0] =3D=3D 'sep' and token[1] =3D=3D '{': token =3D self.token() --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528621862110.83309606862281; Mon, 19 Mar 2018 23:50:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 30D2E7FDC3; Tue, 20 Mar 2018 06:50:20 +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 06D0A620AA; Tue, 20 Mar 2018 06:50:20 +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 B777B4CABB; Tue, 20 Mar 2018 06:50:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nuJf019569 for ; Tue, 20 Mar 2018 02:49:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 66EC360BE7; Tue, 20 Mar 2018 06:49:56 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 607F660BE3 for ; Tue, 20 Mar 2018 06:49:51 +0000 (UTC) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) (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 2FD78356C2 for ; Tue, 20 Mar 2018 06:49:50 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id s18so458990wrg.9 for ; Mon, 19 Mar 2018 23:49:50 -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.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:47 -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=vJM2cxpq07QnpNGjrCiu0HGNrxL3pGxKKdJFTKjd6Oc=; b=n2B6M3ZUlFwXk4/srw8bwfXkw9e8Tfcit89vQVx0+jII9pMOYNAvEQY9yo75T+ktxv EQ5yX/sw7O9JwmRx+t0c2U5sh698K+rHPMg849c1nBl+B5HbySW3SKktOwOpra5/oTYR cV+dbdYNTELBmL9s3ljFUtRZfKs0lWJmzZm3g73G5cA8h0HquDTcaT7tNN/rBqFIsbG2 dqBUnX/fwtf/Rry93f7/2XvY0ENE5hLCBpMvhE39yTurPXHJg9BjL0Pl7YxmD5TgVuZH dVJYTwNM+meAycbgoQatIjPuRg8hzhEQW8qEWAdAhMAjgLaffKUe/BShc44qhtB/LNli dmFw== 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=vJM2cxpq07QnpNGjrCiu0HGNrxL3pGxKKdJFTKjd6Oc=; b=DyyAp4yVq7OtUSXBtJndr6GrQdmfQWZTmVZdvXRftthLkJ7Xb4l7Uki5/R8+lAWN+o 4kHBNxHyrfKgIGIPukeDpG791wuVDmOkkD6se26m5bty6j1vqN76G9jo7afjZ+KEXuht skq625EDBJwVJVzstHU+FLRz/W9tneSx1CTCMgnGP29MgP4c47R1LGAhYiUvTFi6PlBb +NYD3Gg6t9U7YyVWgmDBOKC67zAJ7aL1l2GKZIVhi6wyrJ+QdqOOEuVVmqgqWD1YYWxT t9O0dhT0bzZHkMHWu2nU0Sq36iMdbAmdtGfAmWEJnF7olV+0tEGZIP/fcdxoxth0ul2M JHZQ== X-Gm-Message-State: AElRT7GenJMDdyJkJKzGe2GeEUFJxrjmFYewS/q09LanhlrtDYxXZ1Fx LHFW0gvqArSUc7nKq6gwhBym2/0k X-Google-Smtp-Source: AG47ELukcaXiiLVIk9hyGnBCVhQrLcZ9UboQevn71r1zWAnvtsixttTCOPVvjlIAeAgIaPeYcfDsGA== X-Received: by 10.223.185.21 with SMTP id k21mr12249616wrf.116.1521528588623; Mon, 19 Mar 2018 23:49:48 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:49:01 +0000 Message-Id: <20180320064908.17723-19-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.30]); Tue, 20 Mar 2018 06:49:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 20 Mar 2018 06:49:50 +0000 (UTC) for IP:'209.85.128.193' DOMAIN:'mail-wr0-f193.google.com' HELO:'mail-wr0-f193.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.193 mail-wr0-f193.google.com 209.85.128.193 mail-wr0-f193.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 18/25] apibuild: Simplify strip_lead_star() 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 20 Mar 2018 06:50:21 +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" The method strip_lead_star() removes a single leading asterisk character from a string by ignoring leading whitespace, otherwise it returns the original string. This could be achieved with a single if-statement followed by replace. Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 90d944ccf..d5707d5d1 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -721,15 +721,8 @@ class CParser: self.index.info =3D res =20 def strip_lead_star(self, line): - l =3D len(line) - i =3D 0 - while i < l: - if line[i] =3D=3D ' ' or line[i] =3D=3D '\t': - i +=3D 1 - elif line[i] =3D=3D '*': - return line[:i] + line[i + 1:] - else: - return line + if line.lstrip().startswith('*'): + line =3D line.replace('*', '', 1) return line =20 def cleanupComment(self): --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 152152861846830.66763738294776; Mon, 19 Mar 2018 23:50:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2DF7C7FDC8; Tue, 20 Mar 2018 06:50:17 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9EF91915E; Tue, 20 Mar 2018 06:50:16 +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 86B3A180BAEA; Tue, 20 Mar 2018 06:50:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nsxM019555 for ; Tue, 20 Mar 2018 02:49:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id DC7C24251; Tue, 20 Mar 2018 06:49:54 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D6E4A6134B for ; Tue, 20 Mar 2018 06:49:52 +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 C06DE85543 for ; Tue, 20 Mar 2018 06:49:51 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id h76so1195461wme.4 for ; Mon, 19 Mar 2018 23:49:51 -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.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:49 -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=jIF++vAXmaZAkIpr6LVGYGS92wh84gzp44zFaMqsP+A=; b=l7tqciLUlPxzt2aNc3n7axv8KZLXdiIpDWfpBqM0FOdCP1fNb39VOZ9afcGH2IqGAm 0u6do0BXewHBmfMCEmtq7NXADmUPNmvTGeFRgy69oOtpRgxudJMcEEtu+GFEq/s1GGr4 vWW77YK770/wNuMLSZjjIAVHw/p7Wy+87awolECzt5aXKOtY1ZtJeUWejCkrBl7zJIs2 scd4MF9fhbIZPT6JqCPuEQjDNQlTRaWlT5DdstN72EsQQHmMvl4RzxyzQKBBl8g4FGTC F7Nx1QA+4CeG2XXoOOYUcI6xLDn7oZXghh0wMCt7FVc10EBs9tM0+qqA9YGahcov5dYR R21Q== 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=jIF++vAXmaZAkIpr6LVGYGS92wh84gzp44zFaMqsP+A=; b=V1/sVKH2hY25Xpo7+VjgSX37vD59O7IxrSowVwwLAuP2Gdz/v9qrOmT3yJbF3QXMeF PbLWwNpTgBvlT4c2q2kk2/pQxzL9ImrNITVW1HGeg/O77d4OglWYGzYF95nByoc4p1NI 97Fcg7/Urw2OlX3rbZ5kyol8JNXYHC13pJvCuR2BCAYJ23LRPbzzaaaqOtUTcgO+Tbyz 5Dmlp1WXhgrJ/0FWNZ9h6pE0p3E/Y6pgKQqGVVwKwL/4EmmXFhl5xzcSKTACIdiGek2j /n233etSSkbqbxoe0GmskiMSUgjFJDZdCl80oFEs4m/LdTL4rvblEoipfNuUM54kbQVG pxZw== X-Gm-Message-State: AElRT7Hy/bFAK4QkcJrccyFQ4bA3JIpLX4czRyfmX7PXjSS0qUVYGazC uHLCFTtJadQ1Gf6Y9d+FP0qSBapV X-Google-Smtp-Source: AG47ELvLvjwj6Fu7w8yoF+g8JJOZfQaJodNgv2lyh/Yx7Bl2mH1lfuJ+Si0OkVNejrtNs3ibeRGPKA== X-Received: by 10.28.12.14 with SMTP id 14mr1042888wmm.107.1521528590196; Mon, 19 Mar 2018 23:49:50 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:49:02 +0000 Message-Id: <20180320064908.17723-20-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.28]); Tue, 20 Mar 2018 06:49:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 20 Mar 2018 06:49:52 +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.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 19/25] apibuild: Simplify parseTypeComment() 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 20 Mar 2018 06:50:17 +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" Improve readability and reduce complexity the method parseTypeComment(). Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index d5707d5d1..06d556bae 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -756,48 +756,38 @@ class CParser: # # Parse a comment block associate to a typedef # - def parseTypeComment(self, name, quiet=3D0): + def parseTypeComment(self, name, quiet=3DFalse): if name[0:2] =3D=3D '__': - quiet =3D 1 - - args =3D [] - desc =3D "" + quiet =3D True =20 if self.comment is None: if not quiet: self.warning("Missing comment for type %s" % (name)) - return((args, desc)) - if self.comment[0] !=3D '*': + return None + if not self.comment.startswith('*'): if not quiet: self.warning("Missing * in type comment for %s" % (name)) - return((args, desc)) + return None + lines =3D self.comment.split('\n') - if lines[0] =3D=3D '*': - del lines[0] + # Remove lines that contain only single asterisk + lines[:] =3D [line for line in lines if line.strip() !=3D '*'] + if lines[0] !=3D "* %s:" % (name): if not quiet: self.warning("Misformatted type comment for %s" % (name)) self.warning(" Expecting '* %s:' got '%s'" % (name, lines= [0])) - return((args, desc)) + return None del lines[0] - while len(lines) > 0 and lines[0] =3D=3D '*': - del lines[0] - desc =3D "" - while len(lines) > 0: - l =3D lines[0] - while len(l) > 0 and l[0] =3D=3D '*': - l =3D l[1:] - l =3D l.strip() - desc =3D desc + " " + l - del lines[0] =20 - desc =3D desc.strip() + # Concatenate all remaining lines by striping leading asterisks + desc =3D " ".join([line.lstrip("*").strip() for line in lines]).st= rip() =20 - if quiet =3D=3D 0: - if desc =3D=3D "": - self.warning("Type comment for %s lack description of the = macro" % (name)) + if not (quiet or desc): + self.warning("Type comment for %s lack description of the macr= o" + % (name)) =20 - return(desc) + return desc # # Parse a comment block associate to a macro # --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 152152861626453.309314686614584; Mon, 19 Mar 2018 23:50:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 01E7BC047B89; Tue, 20 Mar 2018 06:50:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CFF1CC5DAE; Tue, 20 Mar 2018 06:50:14 +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 8D1B0180BADC; Tue, 20 Mar 2018 06:50:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nvUV019578 for ; Tue, 20 Mar 2018 02:49:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 408E05C545; Tue, 20 Mar 2018 06:49:57 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 389F75C70F for ; Tue, 20 Mar 2018 06:49:54 +0000 (UTC) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) (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 B4C84C0587C1 for ; Tue, 20 Mar 2018 06:49:53 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id t6so1262812wmt.5 for ; Mon, 19 Mar 2018 23:49:53 -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.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:50 -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=ax0FKeTZFPfd5EJf63LeEvNVhDs9nSdc/GvodOrTy+s=; b=XVo/zZ+PCUTrRzzLoKewMtKw/yKWdHkxorgxbK1v7gUtufQtvJersxjByUJNMoLJlZ /jYFWQpeF5SqSoRdWoqLlFilOJO0Yh6vA2GeA5cYYrOCHjioXd3IcKJO1IjPfTLxkAcQ tETHO6PpbcIt37ssWIzBvM095zIES/Tdbx4NX40BaIrCxAngxOO1cF+T13voDvSqs+bh 292/xnMSisbhYVfVp46gLG0M3p5uvH7NAoe4ZN2AgoHxycCufYB4I5q6MwrOliRE+m+v 10OU48aoYtGiQRI9jCcZc9B4SwutiFDQDRatOmZNelyksku6ahY+YMfgpZiRZG6b6ZB5 k98w== 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=ax0FKeTZFPfd5EJf63LeEvNVhDs9nSdc/GvodOrTy+s=; b=WOR3PnSkxc6O09YW84PpNrr+avDzdSGjowNztGLdgfJpZzB5xCC2FleZmIJ2YWFetA n8XW+qzmhRl686aPAIjv59nP+ku1e4RexZrMhciSqsp3jgMsfEcxT2LesKQGVwyxx73y 1tnWS+dAsyi+ZdXvW7Oubcpf/bu2ARwQ6PMShcRHZazqeqhNw5tlLiKQvDJx+wjCQYmk zgZ3FUjW7x8aKfMB5bV5/F73QN2vk3D+O0GzBIEf7l/qRmCrOVZhVJ+mR90bUH0qR2Ex 8rc5Bmc2qp5Ltk59r2J7tLuIHOUJYzb5ZDvwOcPhmqxWN18hzStiNweYXkO4E3GKTHVI PWTw== X-Gm-Message-State: AElRT7Fmwr47MfKh9V1yq505niCmBU/C5TmYMZ8uHpy+8B3xIKMVqmem Q7KIwB7HD1I3hiGwu5+X1EFNr+w3 X-Google-Smtp-Source: AG47ELtrrcrn7QCZI+Ax9a3fOFtRMNNjTLhRfFLjCohS9UYoY2R6/YBql1/rM8kfADP86jqIKY7baQ== X-Received: by 10.28.84.74 with SMTP id p10mr984049wmi.15.1521528592078; Mon, 19 Mar 2018 23:49:52 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:49:03 +0000 Message-Id: <20180320064908.17723-21-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.32]); Tue, 20 Mar 2018 06:49:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 20 Mar 2018 06:49:53 +0000 (UTC) for IP:'74.125.82.65' DOMAIN:'mail-wm0-f65.google.com' HELO:'mail-wm0-f65.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.65 mail-wm0-f65.google.com 74.125.82.65 mail-wm0-f65.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 20/25] apibuild: Simplify type checking of literals 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.16 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:50:15 +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" Reduce the number of if-statements used to assign a literals to corresponding class variables. Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 06d556bae..f073b36c7 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -283,24 +283,19 @@ class index: d.set_static(1) =20 if d is not None and name is not None and type is not None: - if type =3D=3D "function": - self.functions[name] =3D d - elif type =3D=3D "functype": - self.functions[name] =3D d - elif type =3D=3D "variable": - self.variables[name] =3D d - elif type =3D=3D "include": - self.includes[name] =3D d - elif type =3D=3D "struct": - self.structs[name] =3D d - elif type =3D=3D "union": - self.unions[name] =3D d - elif type =3D=3D "enum": - self.enums[name] =3D d - elif type =3D=3D "typedef": - self.typedefs[name] =3D d - elif type =3D=3D "macro": - self.macros[name] =3D d + type_map =3D { + "function": self.functions, + "functype": self.functions, + "variable": self.variables, + "include": self.includes, + "struct": self.structs, + "union": self.unions, + "enum": self.enums, + "typedef": self.typedefs, + "macro": self.macros + } + if type in type_map: + type_map[type][name] =3D d else: self.warning("Unable to register type ", type) =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 152152862287360.83591031579408; Mon, 19 Mar 2018 23:50:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0888D8124D; Tue, 20 Mar 2018 06:50:21 +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 D23CEC5DAE; Tue, 20 Mar 2018 06:50:20 +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 9B2744CABD; Tue, 20 Mar 2018 06:50:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nvJ4019577 for ; Tue, 20 Mar 2018 02:49:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 40A045C89A; Tue, 20 Mar 2018 06:49:57 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 390385C888 for ; Tue, 20 Mar 2018 06:49:56 +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 5C1E7356C9 for ; Tue, 20 Mar 2018 06:49:55 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id x82so1276912wmg.1 for ; Mon, 19 Mar 2018 23:49:55 -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.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:52 -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=EoXYD4m3QRbR0BM89fpEKIsUbbo+S/fQKcZJX7oefvk=; b=X4M81ClwY8r4IHFMjdpWmzKaDzRlt/zMUDLRXQBq3Kl/gL98SXjkX0N/OQA0ci8bNN +XB+aCljrqJx5bWCkcRd2gFEg07esbzslWIRwVX5bRPbnppxwAcXBrNyR5bEH4N3PJUV yL9xRoCrzkkzrSegW211ibuT32lZ/JwFCh+vNM/LVW8Ue1MJ7ngSjKPY8k+dg+GSp/7M Chrv9IrlAF+JZO3XCxUmZfpstC6y2XDKZMK1m9caCL4LBgMXfGiiatzsIbs20PVoIdKL xxDzt6GnsIIHNkTDw19HZ7zuVB8FYbx3DumWUcHNmrsFdK8eUuIO8cZgstid9YiGxQzl pgQg== 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=EoXYD4m3QRbR0BM89fpEKIsUbbo+S/fQKcZJX7oefvk=; b=KKlG/hkWqrfvQx06mJogIvYBQm/0yqEZUwiKRqmXGTRRWvhznpCrsU4w9RIzP+ueRC fDW6Zt4Awk7hH8cGHklniNrW2tCVfmvJtZFiGvef1gwvPp34NCuAlqPB7rJNafXUh/n+ NJwk/GNENigNZo4o5hRnR2UKDH3oHGiaqH2jMk3xlOTqdhqWFA5o5XuAD3QtAE0mBHLY IHUjezEM8elBzbgFg3xII1haB10Fno2ZTjosS5iquLMcLW5gF189cHsClVQrVixP4N/6 hcE+X4KjBGISmNRS+c4qeRRRYlN6qLti2r8zCCEYGsYkEh501jUsuVFT+8RoOo5h5Asr RcuQ== X-Gm-Message-State: AElRT7FrgY1uIlUlg0sb/SQ7WGELPfqzPhS1LcuXJ/l2AO5QQguQp1Kn z/TpEamGduYkFc1KCFvZpDVnVFgA X-Google-Smtp-Source: AG47ELuE5e4YXas8bt1tmsMrb9P1uuNPufEW/uWtBvKQ1CEWzPTjSkOtPY0TYRHzrMNVOUjqgm81mg== X-Received: by 10.28.49.213 with SMTP id x204mr983540wmx.110.1521528593817; Mon, 19 Mar 2018 23:49:53 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:49:04 +0000 Message-Id: <20180320064908.17723-22-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.30]); Tue, 20 Mar 2018 06:49:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 20 Mar 2018 06:49:55 +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.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 21/25] apibuild: Use list comprehension insteand of map 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 20 Mar 2018 06:50:21 +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" Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index f073b36c7..98224c7e7 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -471,8 +471,7 @@ class CLexer: return None =20 if line[0] =3D=3D '#': - self.tokens =3D list(map((lambda x: ('preproc', x)), - line.split())) + self.tokens =3D [('preproc', word) for word in line.split(= )] =20 # We might have whitespace between the '#' and preproc # macro name, so instead of having a single token element --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 152152862615949.45405004086376; Mon, 19 Mar 2018 23:50:26 -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 E065D81DF6; Tue, 20 Mar 2018 06:50:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7897BA8F; Tue, 20 Mar 2018 06:50:23 +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 74F00180215E; Tue, 20 Mar 2018 06:50:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nxsE019594 for ; Tue, 20 Mar 2018 02:49:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 161075D70C; Tue, 20 Mar 2018 06:49:59 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C9B95D6A8 for ; Tue, 20 Mar 2018 06:49:57 +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 B273F3DE42 for ; Tue, 20 Mar 2018 06:49:56 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id x82so1277016wmg.1 for ; Mon, 19 Mar 2018 23:49:56 -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.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:54 -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=kPo5VTPqmuYpBWoRw2lOlkfyyyIryn8mX6iv/NKh/mI=; b=b60vEcjgQit4OkfgPOZ9T7lnxnvzgsbv4pG1DUuimzqu15sVhkb91UHnNQrzYxKDo9 66cOcn+U9HjOhgUUvGa8HY/0gmYg1iWwAhYZxSSMPFmj4FjJTAwHUntf1tdpaNLrW29X s3IS8a+MFxQzNECyFU6rOIY2fpakbzcj+2QcBv7fd3BXq2NTcPWaSrMgkqAmmXxW94G9 95H2AFMXxdu4pSMy71wGsU5S1ixOjavl3VrL7baaNpN2crhJFXBY3odmEg3pFatGrBS3 UkOiYdRM4Og5F0e8osfC8DL2VYR/AmJWoqzBsFGr4c0gyGHSvPY5wya5AaVre2KutfSj 29mQ== 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=kPo5VTPqmuYpBWoRw2lOlkfyyyIryn8mX6iv/NKh/mI=; b=p0MNXHKsMKtnGyv3x9/UGvvYV0xS0dqH/2i0BGDmEsKPPMWr2utOkYzCau2MunAcMv XC/vYgmXwvWxxEPlMS602Ybd5I7D66J9JCTOm3MusWdZVz+XptzJhPQxiJfWBJjWOCF5 7zVJXejss1IyLIkVP7+XbBeg/c3pQnZawgEk/P2c7jeacTu6EQ1WXFAo9fSOODcoj3r7 hDXUrG8Ay0AQHgZ4A1yVGWH1SxIYHKDpS4pJv7EkdTZUGxnyVof6i5wqipNHHXgbFObB SM7w4/d/HPyQsJg9o7Cu2D4WE0GVH+q7vgyBBpTF1cqCiH3jhYLCua0r1wPqDN76j0iy U1OA== X-Gm-Message-State: AElRT7HYRhyQ/L06vK7Inu5xyVzgYWKYeXaezUlou8SZOgg3cit9eXca wFgfB9B9DCLRBPThDnHPt41++qRb X-Google-Smtp-Source: AG47ELtOGtT4Et+4zFnx+vje0eOouQcJNJco6LJpZ2AYBqMuTv1khSzlYIow83NP9z9zr1sYS1Q85w== X-Received: by 10.28.32.210 with SMTP id g201mr937858wmg.9.1521528595168; Mon, 19 Mar 2018 23:49:55 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:49:05 +0000 Message-Id: <20180320064908.17723-23-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.29]); Tue, 20 Mar 2018 06:49:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 20 Mar 2018 06:49:56 +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.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 22/25] apibuild: Simplify merging of preproc tokens 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.25]); Tue, 20 Mar 2018 06:50:24 +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" Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 98224c7e7..4c8fa5740 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -478,8 +478,8 @@ class CLexer: # of '#define' we might end up with '#' and 'define'. This # merges them back together if self.tokens[0][1] =3D=3D "#": - self.tokens[0] =3D ('preproc', self.tokens[0][1] + sel= f.tokens[1][1]) - self.tokens =3D self.tokens[:1] + self.tokens[2:] + self.tokens[0] =3D ('preproc', "#" + self.tokens[1][1]) + del self.tokens[1] break l =3D len(line) if line[0] =3D=3D '"' or line[0] =3D=3D "'": --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 15215286203661011.9562871947128; Mon, 19 Mar 2018 23:50:20 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 73CB93DE42; Tue, 20 Mar 2018 06:50:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45FE25C888; Tue, 20 Mar 2018 06:50:18 +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 05D40180BAEC; Tue, 20 Mar 2018 06:50:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nw85019589 for ; Tue, 20 Mar 2018 02:49:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id C6CD8C5DA7; Tue, 20 Mar 2018 06:49:58 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BE1FB5C545 for ; Tue, 20 Mar 2018 06:49:58 +0000 (UTC) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) (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 F401C356C2 for ; Tue, 20 Mar 2018 06:49:57 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id f14so457123wre.8 for ; Mon, 19 Mar 2018 23:49:57 -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.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:55 -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=+NrtiXcMnDlhAhkAVbpzi/uRoYKK1hY98PbOp5aO7Qw=; b=q0aDjui4dg6cNHhfPVASk8WXwhUB+c6WiCq518gd5H2oA9Y+ENCOkk7fKorJRIdKsZ IRQjQNnU2bia10h1TqiaFNnhQM15+k9llSg0k1akxBBwEXeNNTXoAgSvtmRwGOctIVA/ bXxsVJWQBLcDST8w6z9kYU7XDuTh6A2UhLv/MyBZaT7tWBVkkdFnpnMQp96sC0Pj8i4m O6IYWSvCt4jDWQ7wF76opFwEQHcNjRAN6WcfyJm5ONsl3YUZznDe4TiLjKYrB/i4syEO sQNxzufAyCkGEEuntrIxVG1CIG8DFj+pxFhZj/Kzka/wTq+OZPS7ABoQnM69ioPfZFLc S3Lg== 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=+NrtiXcMnDlhAhkAVbpzi/uRoYKK1hY98PbOp5aO7Qw=; b=BN1KX7OMDF7UT2sFTU2di4/UC30yMeyROkvGJHa8XcXj7L6HPas1NwMX2BlK6FtABG nN4JHMmhmWECDY5UoOozZFfMmGdgzNhX3R+QpOiiiqMHnkhpPQwiD5xhWlOpv5126kXy j7IB1qvqsR9t/tUfiXWOIicC05aueUr/b3x9GpDJdbDKKfGsjOkiiPLXvi4CGSShxqlV IAcX/c8WwYTDL78hxGuaNh1AloCzEpZvqzui/olIyuwjXrKSvtRHDw+erQgbOGBTJD51 wbxkzw4j5BlZz5mjpvyy1pL2DIDqusN4bX5r11uINrwD83Qj79eODSUh1RpkIn+lTA2Y la2g== X-Gm-Message-State: AElRT7EfvEzAu/CqDAHshhVFPBdZRlpALcsrLrZ8fvEzkHpinHJwB4JN viR2gWC8FeAK/m6AN52k0nnCqcd8 X-Google-Smtp-Source: AG47ELsz3HADe+rZ54jgzZlWzesPM47IP7bmQgkPbGbwes1Yc7B4aER/Nnt48p/DBff4ADRWdlEzFg== X-Received: by 10.223.193.10 with SMTP id r10mr775224wre.255.1521528596452; Mon, 19 Mar 2018 23:49:56 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:49:06 +0000 Message-Id: <20180320064908.17723-24-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.30]); Tue, 20 Mar 2018 06:49:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 20 Mar 2018 06:49:58 +0000 (UTC) for IP:'209.85.128.196' DOMAIN:'mail-wr0-f196.google.com' HELO:'mail-wr0-f196.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.196 mail-wr0-f196.google.com 209.85.128.196 mail-wr0-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 23/25] apibuild: Simplify parsing string tokens 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 20 Mar 2018 06:50:18 +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" Improve readability and reduce the complexity of the code that is searching for string tokens (i.e. characters surrounded by a single or double quote). Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 4c8fa5740..94de13b56 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -483,28 +483,16 @@ class CLexer: break l =3D len(line) if line[0] =3D=3D '"' or line[0] =3D=3D "'": - end =3D line[0] - line =3D line[1:] - found =3D 0 - tok =3D "" - while found =3D=3D 0: - i =3D 0 - l =3D len(line) - while i < l: - if line[i] =3D=3D end: - self.line =3D line[i+1:] - line =3D line[:i] - l =3D i - found =3D 1 - break - if line[i] =3D=3D '\\': - i =3D i + 1 - i =3D i + 1 - tok =3D tok + line - if found =3D=3D 0: - line =3D self.getline() - if line is None: - return None + quote =3D line[0] + i =3D 1 + while quote not in line[i:]: + i =3D len(line) + nextline =3D self.getline() + if nextline is None: + return None + line +=3D nextline + + tok, self.line =3D line[1:].split(quote, 1) self.last =3D ('string', tok) return self.last =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 15215286239761015.5599361269973; Mon, 19 Mar 2018 23:50:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B5B3B81254; Tue, 20 Mar 2018 06:50:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A12E5D70C; Tue, 20 Mar 2018 06:50:21 +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 564241805972; Tue, 20 Mar 2018 06:50:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6o1OT019613 for ; Tue, 20 Mar 2018 02:50:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8454D60BE3; Tue, 20 Mar 2018 06:50:01 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 762F25FCA2 for ; Tue, 20 Mar 2018 06:50:01 +0000 (UTC) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) (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 C2C3A80464 for ; Tue, 20 Mar 2018 06:49:59 +0000 (UTC) Received: by mail-wm0-f53.google.com with SMTP id 139so1275514wmn.2 for ; Mon, 19 Mar 2018 23:49:59 -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.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:57 -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=0iYdIJ+Axaudr0gNItw/mQRrFrcfzYP3KZKc4c2iYDk=; b=KxevZu1yC4nZx3anAMTVbXStAiAfO2p78ahhLrL+A0k1bLGrkpnyMl5045tYCsnngt gqteJxctkEjDpZfNy+xaEkW1nEXN3Rq8Wc1EneSkd8ZeuJpDcjdvdm9GAqhNMwRgHD1h MUL22HzHMwKJeFNbnnIiAWHOcnoFOcUGOHnyo4G6+1rxI/fgMuY9F0QdeXesEGen2coh KscAK74FLWdREP2IZ1e1WQ0cOHuPSZp4FEdTC06EP6Qv9RVLxD+ATsemzFUFZy1h3BO3 X04c0O4e2EwuFOIYro4sMFwXvQg5Iiue+aOVyXE15nA4a4AUh/eZNp42mEyKkDHQKJiU uLVA== 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=0iYdIJ+Axaudr0gNItw/mQRrFrcfzYP3KZKc4c2iYDk=; b=qp0H4HiNKhAlzVVW+JpiT6IOlwOVaF5xdtvFmOitt2fhrCBgxOmRzIgybNM+EKJMu3 qdR4Gz1zZuvAJwjFUIFnsilRr84JpCg/MmXOAXalJsTWwsmfyMRZ2YjR+ZrEnoG59yJ3 DnPD24QQG0aGGASrGawMpTaqPnX9uIlnbdgVoNrKo57Q0DE4Rd26BTdMYmsFXtbthoim 9xysjLKj4EmK9C5Ijzysq8YO/isC5WQd5p8FjfF1q4UODClQCxiSFLPJg5judgnX1wKj /KhBY+VI/2SlaZYF8AWFQiwGdmQOkXxTgqAG/6Mzme9B4S8vSGkytA7We5l9y7WBY68H aQKw== X-Gm-Message-State: AElRT7GbaFMwdozixbLSARW/9Kt8pntZCU1pzfsC65faWrfItZ5tTEfR LChKjSfSlF8q2Y+bmVFTP23G06He X-Google-Smtp-Source: AG47ELtDu4TngQyCMMxIglJdxlKbX0cGvLXElnTZ9Lw9luMc2Yi2rXAL8yCMnBGlGqICAKW5lLSiWA== X-Received: by 10.28.126.20 with SMTP id z20mr1036403wmc.152.1521528598012; Mon, 19 Mar 2018 23:49:58 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:49:07 +0000 Message-Id: <20180320064908.17723-25-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.28]); Tue, 20 Mar 2018 06:50:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 20 Mar 2018 06:50:00 +0000 (UTC) for IP:'74.125.82.53' DOMAIN:'mail-wm0-f53.google.com' HELO:'mail-wm0-f53.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.53 mail-wm0-f53.google.com 74.125.82.53 mail-wm0-f53.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 24/25] apibuild: Remove redundant parentheses 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 20 Mar 2018 06:50:22 +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" http://pylint-messages.wikidot.com/messages:c0325 Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 74 ++++++++++++++++++++++++++++------------------------= ---- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 94de13b56..1f9c8f12c 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -156,7 +156,7 @@ class identifier: if self.static: r =3D r + " static" if self.module is not None: - r =3D r + " from %s" % (self.module) + r =3D r + " from %s" % self.module if self.info is not None: r =3D r + " " + repr(self.info) if self.extra is not None: @@ -458,7 +458,7 @@ class CLexer: def debug(self): print("Last token: ", self.last) print("Token queue: ", self.tokens) - print("Line %d end: " % (self.lineno), self.line) + print("Line %d end: " % self.lineno, self.line) =20 def token(self): while self.tokens =3D=3D []: @@ -744,20 +744,20 @@ class CParser: =20 if self.comment is None: if not quiet: - self.warning("Missing comment for type %s" % (name)) + self.warning("Missing comment for type %s" % name) return None if not self.comment.startswith('*'): if not quiet: - self.warning("Missing * in type comment for %s" % (name)) + self.warning("Missing * in type comment for %s" % name) return None =20 lines =3D self.comment.split('\n') # Remove lines that contain only single asterisk lines[:] =3D [line for line in lines if line.strip() !=3D '*'] =20 - if lines[0] !=3D "* %s:" % (name): + if lines[0] !=3D "* %s:" % name: if not quiet: - self.warning("Misformatted type comment for %s" % (name)) + self.warning("Misformatted type comment for %s" % name) self.warning(" Expecting '* %s:' got '%s'" % (name, lines= [0])) return None del lines[0] @@ -767,7 +767,7 @@ class CParser: =20 if not (quiet or desc): self.warning("Type comment for %s lack description of the macr= o" - % (name)) + % name) =20 return desc # @@ -786,33 +786,33 @@ class CParser: =20 if self.comment is None: if not quiet: - self.warning("Missing comment for macro %s" % (name)) - return((args, desc)) + self.warning("Missing comment for macro %s" % name) + return args, desc if self.comment[0] !=3D '*': if not quiet: - self.warning("Missing * in macro comment for %s" % (name)) - return((args, desc)) + self.warning("Missing * in macro comment for %s" % name) + return args, desc lines =3D self.comment.split('\n') if lines[0] =3D=3D '*': del lines[0] - if lines[0] !=3D "* %s:" % (name): + if lines[0] !=3D "* %s:" % name: if not quiet: - self.warning("Misformatted macro comment for %s" % (name)) + self.warning("Misformatted macro comment for %s" % name) self.warning(" Expecting '* %s:' got '%s'" % (name, lines= [0])) - return((args, desc)) + return args, desc del lines[0] while lines[0] =3D=3D '*': del lines[0] while len(lines) > 0 and lines[0][0:3] =3D=3D '* @': l =3D lines[0][3:] try: - (arg, desc) =3D l.split(':', 1) + arg, desc =3D l.split(':', 1) desc =3D desc.strip() arg =3D arg.strip() except: if not quiet: - self.warning("Misformatted macro comment for %s" % (na= me)) - self.warning(" problem with '%s'" % (lines[0])) + self.warning("Misformatted macro comment for %s" % nam= e) + self.warning(" problem with '%s'" % lines[0]) del lines[0] continue del lines[0] @@ -841,9 +841,9 @@ class CParser: =20 if quiet =3D=3D 0: if desc =3D=3D "": - self.warning("Macro comment for %s lack description of the= macro" % (name)) + self.warning("Macro comment for %s lack description of the= macro" % name) =20 - return((args, desc)) + return args, desc =20 # # Parse a comment block and merge the information found in the @@ -860,26 +860,26 @@ class CParser: if name in ignored_functions: quiet =3D 1 =20 - (ret, args) =3D description + ret, args =3D description desc =3D "" retdesc =3D "" =20 if self.comment is None: if not quiet: - self.warning("Missing comment for function %s" % (name)) - return(((ret[0], retdesc), args, desc)) + self.warning("Missing comment for function %s" % name) + return (ret[0], retdesc), args, desc if self.comment[0] !=3D '*': if not quiet: - self.warning("Missing * in function comment for %s" % (nam= e)) - return(((ret[0], retdesc), args, desc)) + self.warning("Missing * in function comment for %s" % name) + return (ret[0], retdesc), args, desc lines =3D self.comment.split('\n') if lines[0] =3D=3D '*': del lines[0] - if lines[0] !=3D "* %s:" % (name): + if lines[0] !=3D "* %s:" % name: if not quiet: - self.warning("Misformatted function comment for %s" % (nam= e)) + self.warning("Misformatted function comment for %s" % name) self.warning(" Expecting '* %s:' got '%s'" % (name, lines= [0])) - return(((ret[0], retdesc), args, desc)) + return (ret[0], retdesc), args, desc del lines[0] while lines[0] =3D=3D '*': del lines[0] @@ -887,13 +887,13 @@ class CParser: while len(lines) > 0 and lines[0][0:3] =3D=3D '* @': l =3D lines[0][3:] try: - (arg, desc) =3D l.split(':', 1) + arg, desc =3D l.split(':', 1) desc =3D desc.strip() arg =3D arg.strip() except: if not quiet: - self.warning("Misformatted function comment for %s" % = (name)) - self.warning(" problem with '%s'" % (lines[0])) + self.warning("Misformatted function comment for %s" % = name) + self.warning(" problem with '%s'" % lines[0]) del lines[0] continue del lines[0] @@ -966,12 +966,12 @@ class CParser: self.warning("Function comment for %s lacks descriptio= n of arg %s" % (name, args[i][1])) i =3D i + 1 if retdesc =3D=3D "" and ret[0] !=3D "void": - self.warning("Function comment for %s lacks description of= return value" % (name)) + self.warning("Function comment for %s lacks description of= return value" % name) if desc =3D=3D "": - self.warning("Function comment for %s lacks description of= the function" % (name)) + self.warning("Function comment for %s lacks description of= the function" % name) =20 =20 - return(((ret[0], retdesc), args, desc)) + return (ret[0], retdesc), args, desc =20 def parsePreproc(self, token): if debug: @@ -1362,7 +1362,7 @@ class CParser: try: value =3D "%d" % (int(value) + 1) except: - self.warning("Failed to compute value of enum %s" = % (name)) + self.warning("Failed to compute value of enum %s" = % name) value =3D "" if token[0] =3D=3D "sep" and token[1] =3D=3D ",": if commentsBeforeVal: @@ -1822,7 +1822,7 @@ class CParser: raise Exception() except: self.error(("function '%s' is not allowed to return long, " - "use long long instead") % (name)) + "use long long instead") % name) =20 for param in signature: if "long" in param[0] and "long long" not in param[0]: @@ -2156,7 +2156,7 @@ class docBuilder: name, escape(desc))) self.indexString(name, desc) else: - output.write(" \n" % (name)) + output.write(" \n" % name) output.write(" \n") =20 def serialize_union(self, output, field, desc): @@ -2195,7 +2195,7 @@ class docBuilder: else: output.write(" \n" % (field[1], field[0], desc)) except: - self.warning("Failed to serialize struct %s" % (name)) + self.warning("Failed to serialize struct %s" % name) output.write(" \n") else: output.write("/>\n") --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 02:56:49 2024 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 1521528626097203.62673646122516; Mon, 19 Mar 2018 23:50:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B555E5AFC4; Tue, 20 Mar 2018 06:50:24 +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 80C30C5DA7; Tue, 20 Mar 2018 06:50:24 +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 46ACA4A49B; Tue, 20 Mar 2018 06:50:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6o1Vg019618 for ; Tue, 20 Mar 2018 02:50:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id A1868BA92; Tue, 20 Mar 2018 06:50:01 +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 96821BA8F for ; Tue, 20 Mar 2018 06:50:01 +0000 (UTC) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) (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 C7071C047B62 for ; Tue, 20 Mar 2018 06:50:00 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id z73so470445wrb.0 for ; Mon, 19 Mar 2018 23:50:00 -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.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:58 -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=hM5uw4yFYefOpehfSWNiZ8mmlunczSCsW672JIRaSwM=; b=uUVp21AzGM+KrvC1JR/vxocz89uzuf4l3B2NtGQ6BIwTZDLsylm8P4QnbdH3xOYdOV EAmNdAq9tUooklqEhZKx3cTTPEj/zL0SfgWj+YwnDNXFmJgWjZnPynRdGI46XohfOkO3 G31+aaJohDeO70ClfUZjymoOKix8CzP4HonAQTdTKRkKmEb0bPVwil+UnPvj93xtj076 e5muxj0R30bSyFb0SZJ9dqR9v4QHW4pg3VuOXOqbjIBJz/su+IBvdoCCmHe/hdqho29Q 3S4YXu1NVDuzf6gKL4q9LA0jui2PBc6fwQmrk4xRgZL76z2fFoeyNgLPFfvzuhJ6qu0s 3wbg== 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=hM5uw4yFYefOpehfSWNiZ8mmlunczSCsW672JIRaSwM=; b=r/VhRsfD24ylffSPdRAiZijB9v1TvdIzWy29g0axWjhBJpP9e0Rn4vB/UPqDtISf/x fV0fE1BjRWWgeUDqtATfaWR6xCbchGDXbj/383MTbc1/f3MglWv4sII8L3lgqSVi4338 hymEerQABdnXXiJ+eht6lk2vC2X15vpSaRp6+KIvpW6Qb5+VECK87FoFapIy3+v4y7yH pmMRv5bT99itHY75BDtnqOtQBTouDa/vg3AtJRiPgj4U/7s9Iu0aSef4MIpUlxznapYm chOQ04MW8KmhgBxkRi89QAEpxWi52kQnKpuSHeaeqSsqDha0mLPDZKXqQi23fnXsgufr Qctg== X-Gm-Message-State: AElRT7HbYUxcjMt1BS9i90fxYfBG4rz1DHfFGV7m5hs7w96vUALzSoBQ KdW8AbrheFu9E8oRIdBVJexfB0lN X-Google-Smtp-Source: AG47ELthAHnyWz1Klf6Qg3wsFOBr9xUtHWggARreZSXEUr8IrgCry+pnRobbZl6DdgjqZ48e+nqoAw== X-Received: by 10.223.152.138 with SMTP id w10mr589653wrb.34.1521528599225; Mon, 19 Mar 2018 23:49:59 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:49:08 +0000 Message-Id: <20180320064908.17723-26-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:50:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 20 Mar 2018 06:50:00 +0000 (UTC) for IP:'209.85.128.196' DOMAIN:'mail-wr0-f196.google.com' HELO:'mail-wr0-f196.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.196 mail-wr0-f196.google.com 209.85.128.196 mail-wr0-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 25/25] apibuild: Simplify getline() 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 20 Mar 2018 06:50:25 +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" Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 1f9c8f12c..5e218a9ad 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -432,21 +432,17 @@ class CLexer: line =3D self.input.readline() if not line: return None - self.lineno =3D self.lineno + 1 - line =3D line.lstrip() - line =3D line.rstrip() + self.lineno +=3D 1 + line =3D line.strip() if line =3D=3D '': continue while line[-1] =3D=3D '\\': line =3D line[:-1] - n =3D self.input.readline() - self.lineno =3D self.lineno + 1 - n =3D n.lstrip() - n =3D n.rstrip() + n =3D self.input.readline().strip() + self.lineno +=3D 1 if not n: break - else: - line =3D line + n + line +=3D n return line =20 def getlineno(self): --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list