提交 e633461b 编写于 作者: J Ján Tomko

scripts: use in even more

Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 65366bd9
......@@ -128,7 +128,7 @@ with open(proto, "r") as fh:
api = name_to_ProcName(m.group(1))
# Event filtering is handled in daemon/remote.c
# instead of drivers
if line.find("_EVENT_REGISTER") == -1:
if "_EVENT_REGISTER" not in line:
filteredmap[api] = True
incomment = False
......
......@@ -33,7 +33,7 @@ def checkdriverimpls(filename):
for line in fh:
lineno = lineno + 1
if intable:
if line.find("}") != -1:
if "}" in line:
intable = False
mainprefix = None
continue
......
......@@ -36,9 +36,9 @@ ret = 0
with open(symfile, "r") as fh:
for line in fh:
line = line.strip()
if line.find("{") != -1:
if "{" in line:
continue
if line.find("}") != -1:
if "}" in line:
continue
if line in ["global:", "local:"]:
continue
......@@ -46,7 +46,7 @@ with open(symfile, "r") as fh:
continue
if line[0] == '#':
continue
if line.find("*") != -1:
if "*" in line:
continue
line = line.strip(";")
......
......@@ -49,9 +49,9 @@ with open(dtrace, "r") as fh:
line = line.strip()
if line == "":
continue
if line.find("provider ") != -1 and line.find("{") != -1:
if "provider " in line and "{" in line:
continue
if line.find("};") != -1:
if "};" in line:
continue
if line.startswith("#"):
......@@ -126,7 +126,7 @@ for file in filelist:
for idx in range(len(argbits)):
arg = argbits[idx]
isstr = False
if arg.find("char *") != -1:
if 'char *' in arg:
isstr = True
m = re.search(r'''^.*\s\*?(\S+)$''', arg)
......
......@@ -55,13 +55,13 @@ aclfile = sys.argv[1]
with open(aclfile, "r") as fh:
for line in fh:
if in_opts:
if line.find("*/") != -1:
if "*/" in line:
in_opts = False
else:
m = re.search(r'''\*\s*\@(\w+):\s*(.*?)\s*$''', line)
if m is not None:
opts[m.group(1)] = m.group(2)
elif line.find("**") != -1:
elif "**" in line:
in_opts = True
else:
m = re.search(r'''VIR_ACCESS_PERM_(%s)_((?:\w|_)+),''' %
......
......@@ -46,7 +46,7 @@ def load_file(fh):
instatus = True
elif re.search(r'''enum remote_auth_type''', line):
inauth = True
elif line.find("}") != -1:
elif "}" in line:
intype = False
instatus = False
inauth = False
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册