summaryrefslogtreecommitdiff
path: root/generator.py
diff options
context:
space:
mode:
authorPhilipp Hahn <hahn@univention.de>2018-11-20 13:37:29 +0100
committerJano Tomko <jtomko@redhat.com>2020-09-01 13:26:01 +0000
commit425901da213d127b9b435e3fcaa03c7036d8f6d7 (patch)
tree984942d54abe4f40bdda9c6f8803151f5a0a74cf /generator.py
parentd56097151399cf9dd7c43e621c00220452832070 (diff)
downloadlibvirt-python-425901da213d127b9b435e3fcaa03c7036d8f6d7.tar.gz
generator: Convert in_function to bool
Signed-off-by: Philipp Hahn <hahn@univention.de>
Diffstat (limited to 'generator.py')
-rwxr-xr-xgenerator.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/generator.py b/generator.py
index 9404fc3..188d20e 100755
--- a/generator.py
+++ b/generator.py
@@ -58,7 +58,7 @@ def parse(data):
class docParser(xml.sax.handler.ContentHandler):
def __init__(self):
self._data = []
- self.in_function = 0
+ self.in_function = False
def characters(self, text):
if debug:
@@ -70,7 +70,7 @@ class docParser(xml.sax.handler.ContentHandler):
print("start %s, %s" % (tag, attrs))
if tag == 'function':
self._data = []
- self.in_function = 1
+ self.in_function = True
self.function = None
self.function_cond = None
self.function_args = []
@@ -89,7 +89,7 @@ class docParser(xml.sax.handler.ContentHandler):
elif tag == 'info':
self._data = []
elif tag == 'arg':
- if self.in_function == 1:
+ if self.in_function:
self.function_arg_name = None
self.function_arg_type = None
self.function_arg_info = None
@@ -102,7 +102,7 @@ class docParser(xml.sax.handler.ContentHandler):
if 'info' in attrs:
self.function_arg_info = attrs['info']
elif tag == 'return':
- if self.in_function == 1:
+ if self.in_function:
self.function_return_type = None
self.function_return_info = None
self.function_return_field = None
@@ -161,24 +161,24 @@ class docParser(xml.sax.handler.ContentHandler):
self.function_return, self.function_args,
self.function_file, self.function_module,
self.function_cond)
- self.in_function = 0
+ self.in_function = False
elif tag == 'arg':
- if self.in_function == 1:
+ if self.in_function:
self.function_args.append([self.function_arg_name,
self.function_arg_type,
self.function_arg_info])
elif tag == 'return':
- if self.in_function == 1:
+ if self.in_function:
self.function_return = [self.function_return_type,
self.function_return_info,
self.function_return_field]
elif tag == 'info':
str = ''.join(self._data)
- if self.in_function == 1:
+ if self.in_function:
self.function_descr = str
elif tag == 'cond':
str = ''.join(self._data)
- if self.in_function == 1:
+ if self.in_function:
self.function_cond = str