提交 eb327e6c 编写于 作者: R Radostin Stoyanov 提交者: Daniel P. Berrangé

apibuild: Fix indentation not multiple of 4

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.htmlReviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
Signed-off-by: NRadostin Stoyanov <rstoyanov1@gmail.com>
上级 aad30c3e
......@@ -251,7 +251,8 @@ class index:
d = self.identifiers[name]
d.update(header, module, type, lineno, info, extra, conditionals)
except:
d = identifier(name, header, module, type, lineno, info, extra, conditionals)
d = identifier(name, header, module, type, lineno, info, extra,
conditionals)
self.identifiers[name] = d
if d is not None and static == 1:
......@@ -265,7 +266,8 @@ class index:
return d
def add(self, name, header, module, static, type, lineno, info=None, extra=None, conditionals=None):
def add(self, name, header, module, static, type, lineno, info=None,
extra=None, conditionals=None):
if name[0:2] == '__':
return None
d = None
......@@ -273,7 +275,8 @@ class index:
d = self.identifiers[name]
d.update(header, module, type, lineno, info, extra, conditionals)
except:
d = identifier(name, header, module, type, lineno, info, extra, conditionals)
d = identifier(name, header, module, type, lineno, info, extra,
conditionals)
self.identifiers[name] = d
if d is not None and static == 1:
......@@ -389,7 +392,8 @@ class index:
" for %s:" % id)
self.warning(" H: %s" % self.functions[id].conditionals)
self.warning(" C: %s" % up.conditionals)
self.functions[id].update(None, up.module, up.type, up.info, up.extra)
self.functions[id].update(None, up.module, up.type, up.info,
up.extra)
# else:
# print("Function %s from %s is not declared in headers" % (
# id, idx.functions[id].module))
......@@ -1160,7 +1164,7 @@ class CParser:
return None
base_type = self.type
type = base_type
#self.debug("end typedef type", token)
# self.debug("end typedef type", token)
while token is not None:
if token[0] == "name":
name = 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] == 'sep' and token[1] == ',':
type = base_type
token = self.token()
......@@ -1247,22 +1251,22 @@ class CParser:
#
def parseStruct(self, token):
fields = []
#self.debug("start parseStruct", token)
# self.debug("start parseStruct", token)
while token is not None:
if token[0] == "sep" and token[1] == "{":
token = self.token()
token = self.parseTypeBlock(token)
elif token[0] == "sep" and token[1] == "}":
self.struct_fields = fields
#self.debug("end parseStruct", token)
#print(fields)
# self.debug("end parseStruct", token)
# print(fields)
token = self.token()
return token
else:
base_type = self.type
#self.debug("before parseType", token)
# self.debug("before parseType", token)
token = self.parseType(token)
#self.debug("after parseType", token)
# self.debug("after parseType", token)
if token is not None and token[0] == "name":
fname = token[1]
token = self.token()
......@@ -1293,8 +1297,8 @@ class CParser:
token = self.token()
self.type = base_type
self.struct_fields = fields
#self.debug("end parseStruct", token)
#print(fields)
# self.debug("end parseStruct", token)
# print(fields)
return token
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册