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