mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-12-01 08:23:47 +03:00
generator: Remove global declarations
for variables with are not assigned. Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
28
generator.py
28
generator.py
@@ -200,7 +200,6 @@ class docParser(xml.sax.handler.ContentHandler):
|
||||
|
||||
|
||||
def function(name, desc, ret, args, file, module, cond):
|
||||
global onlyOverrides
|
||||
if onlyOverrides and name not in functions:
|
||||
return
|
||||
if name == "virConnectListDomains":
|
||||
@@ -209,14 +208,12 @@ def function(name, desc, ret, args, file, module, cond):
|
||||
|
||||
|
||||
def qemu_function(name, desc, ret, args, file, module, cond):
|
||||
global onlyOverrides
|
||||
if onlyOverrides and name not in qemu_functions:
|
||||
return
|
||||
qemu_functions[name] = (desc, ret, args, file, module, cond)
|
||||
|
||||
|
||||
def lxc_function(name, desc, ret, args, file, module, cond):
|
||||
global onlyOverrides
|
||||
if onlyOverrides and name not in lxc_functions:
|
||||
return
|
||||
lxc_functions[name] = (desc, ret, args, file, module, cond)
|
||||
@@ -677,14 +674,6 @@ function_skip_index_one = (
|
||||
|
||||
|
||||
def print_function_wrapper(module, name, output, export, include):
|
||||
global py_types
|
||||
global unknown_types
|
||||
global functions
|
||||
global lxc_functions
|
||||
global qemu_functions
|
||||
global skipped_modules
|
||||
global function_skip_python_impl
|
||||
|
||||
try:
|
||||
if module == "libvirt":
|
||||
(desc, ret, args, file, mod, cond) = functions[name]
|
||||
@@ -895,8 +884,6 @@ def print_c_pointer(classname, output, export, include):
|
||||
|
||||
|
||||
def buildStubs(module, api_xml):
|
||||
global py_types
|
||||
global unknown_types
|
||||
global onlyOverrides
|
||||
|
||||
if module not in ["libvirt", "libvirt-qemu", "libvirt-lxc"]:
|
||||
@@ -1369,17 +1356,6 @@ def writeDoc(module, name, args, indent, output):
|
||||
|
||||
|
||||
def buildWrappers(module):
|
||||
global ctypes
|
||||
global py_types
|
||||
global unknown_types
|
||||
global functions
|
||||
global function_classes
|
||||
global classes_type
|
||||
global classes_list
|
||||
global primary_classes
|
||||
global classes_destructors
|
||||
global functions_noexcept
|
||||
|
||||
if not module == "libvirt":
|
||||
print("ERROR: Unknown module type: %s" % module)
|
||||
return None
|
||||
@@ -1827,8 +1803,6 @@ def buildWrappers(module):
|
||||
|
||||
|
||||
def qemuBuildWrappers(module):
|
||||
global qemu_functions
|
||||
|
||||
if not module == "libvirt-qemu":
|
||||
print("ERROR: only libvirt-qemu is supported")
|
||||
return None
|
||||
@@ -1936,8 +1910,6 @@ def qemuBuildWrappers(module):
|
||||
|
||||
|
||||
def lxcBuildWrappers(module):
|
||||
global lxc_functions
|
||||
|
||||
if not module == "libvirt-lxc":
|
||||
print("ERROR: only libvirt-lxc is supported")
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user