scripts: use in even more

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Ján Tomko 2019-11-20 20:10:13 +01:00
parent 65366bd960
commit e633461bdf
6 changed files with 11 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -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(";")

View File

@ -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)

View File

@ -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|_)+),''' %

View File

@ -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