[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/34] qapi/common.py: Replace one-letter 'c' variable
From: |
Markus Armbruster |
Subject: |
[PULL 13/34] qapi/common.py: Replace one-letter 'c' variable |
Date: |
Sat, 10 Oct 2020 11:54:43 +0200 |
From: John Snow <jsnow@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20201009161558.107041-14-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
scripts/qapi/common.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index a417b6029c..338adedef4 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -30,14 +30,14 @@ def camel_to_upper(value):
new_name = ''
length = len(c_fun_str)
for i in range(length):
- c = c_fun_str[i]
- # When c is upper and no '_' appears before, do more checks
- if c.isupper() and (i > 0) and c_fun_str[i - 1] != '_':
+ char = c_fun_str[i]
+ # When char is upper case and no '_' appears before, do more checks
+ if char.isupper() and (i > 0) and c_fun_str[i - 1] != '_':
if i < length - 1 and c_fun_str[i + 1].islower():
new_name += '_'
elif c_fun_str[i - 1].isdigit():
new_name += '_'
- new_name += c
+ new_name += char
return new_name.lstrip('_').upper()
--
2.26.2
- [PULL 00/34] QAPI patches patches for 2020-10-10, Markus Armbruster, 2020/10/10
- [PULL 13/34] qapi/common.py: Replace one-letter 'c' variable,
Markus Armbruster <=
- [PULL 03/34] qapi-gen: Separate arg-parsing from generation, Markus Armbruster, 2020/10/10
- [PULL 01/34] docs: repair broken references, Markus Armbruster, 2020/10/10
- [PULL 07/34] qapi: enforce import order/styling with isort, Markus Armbruster, 2020/10/10
- [PULL 08/34] qapi: delint using flake8, Markus Armbruster, 2020/10/10
- [PULL 11/34] qapi/common.py: Add indent manager, Markus Armbruster, 2020/10/10
- [PULL 12/34] qapi/common.py: delint with pylint, Markus Armbruster, 2020/10/10
- [PULL 02/34] qapi: modify docstrings to be sphinx-compatible, Markus Armbruster, 2020/10/10
- [PULL 15/34] qapi/common.py: add type hint annotations, Markus Armbruster, 2020/10/10
- [PULL 05/34] qapi: Prefer explicit relative imports, Markus Armbruster, 2020/10/10
- [PULL 14/34] qapi/common.py: check with pylint, Markus Armbruster, 2020/10/10