mirror of https://gitee.com/openkylin/libvirt.git
Test for object identity when checking for None in Python
Consistently use "is" or "is not" to compare variables to None, because doing so is preferrable, as per PEP 8 (http://www.python.org/dev/peps/pep-0008/#programming-recommendations): > Comparisons to singletons like None should always be done with is or > is not, never the equality operators.
This commit is contained in:
parent
6e17210930
commit
2a40951148
254
docs/apibuild.py
254
docs/apibuild.py
|
@ -111,7 +111,7 @@ class identifier:
|
||||||
self.extra = extra
|
self.extra = extra
|
||||||
self.lineno = lineno
|
self.lineno = lineno
|
||||||
self.static = 0
|
self.static = 0
|
||||||
if conditionals == None or len(conditionals) == 0:
|
if conditionals is None or len(conditionals) == 0:
|
||||||
self.conditionals = None
|
self.conditionals = None
|
||||||
else:
|
else:
|
||||||
self.conditionals = conditionals[:]
|
self.conditionals = conditionals[:]
|
||||||
|
@ -123,13 +123,13 @@ class identifier:
|
||||||
r = "%s %s:" % (self.type, self.name)
|
r = "%s %s:" % (self.type, self.name)
|
||||||
if self.static:
|
if self.static:
|
||||||
r = r + " static"
|
r = r + " static"
|
||||||
if self.module != None:
|
if self.module is not None:
|
||||||
r = r + " from %s" % (self.module)
|
r = r + " from %s" % (self.module)
|
||||||
if self.info != None:
|
if self.info is not None:
|
||||||
r = r + " " + `self.info`
|
r = r + " " + `self.info`
|
||||||
if self.extra != None:
|
if self.extra is not None:
|
||||||
r = r + " " + `self.extra`
|
r = r + " " + `self.extra`
|
||||||
if self.conditionals != None:
|
if self.conditionals is not None:
|
||||||
r = r + " " + `self.conditionals`
|
r = r + " " + `self.conditionals`
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ class identifier:
|
||||||
def set_static(self, static):
|
def set_static(self, static):
|
||||||
self.static = static
|
self.static = static
|
||||||
def set_conditionals(self, conditionals):
|
def set_conditionals(self, conditionals):
|
||||||
if conditionals == None or len(conditionals) == 0:
|
if conditionals is None or len(conditionals) == 0:
|
||||||
self.conditionals = None
|
self.conditionals = None
|
||||||
else:
|
else:
|
||||||
self.conditionals = conditionals[:]
|
self.conditionals = conditionals[:]
|
||||||
|
@ -178,17 +178,17 @@ class identifier:
|
||||||
if self.name == debugsym and not quiet:
|
if self.name == debugsym and not quiet:
|
||||||
print "=> update %s : %s" % (debugsym, (module, type, info,
|
print "=> update %s : %s" % (debugsym, (module, type, info,
|
||||||
extra, conditionals))
|
extra, conditionals))
|
||||||
if header != None and self.header == None:
|
if header is not None and self.header is None:
|
||||||
self.set_header(module)
|
self.set_header(module)
|
||||||
if module != None and (self.module == None or self.header == self.module):
|
if module is not None and (self.module is None or self.header == self.module):
|
||||||
self.set_module(module)
|
self.set_module(module)
|
||||||
if type != None and self.type == None:
|
if type is not None and self.type is None:
|
||||||
self.set_type(type)
|
self.set_type(type)
|
||||||
if info != None:
|
if info is not None:
|
||||||
self.set_info(info)
|
self.set_info(info)
|
||||||
if extra != None:
|
if extra is not None:
|
||||||
self.set_extra(extra)
|
self.set_extra(extra)
|
||||||
if conditionals != None:
|
if conditionals is not None:
|
||||||
self.set_conditionals(conditionals)
|
self.set_conditionals(conditionals)
|
||||||
|
|
||||||
class index:
|
class index:
|
||||||
|
@ -217,10 +217,10 @@ class index:
|
||||||
d = identifier(name, header, module, type, lineno, info, extra, conditionals)
|
d = identifier(name, header, module, type, lineno, info, extra, conditionals)
|
||||||
self.identifiers[name] = d
|
self.identifiers[name] = d
|
||||||
|
|
||||||
if d != None and static == 1:
|
if d is not None and static == 1:
|
||||||
d.set_static(1)
|
d.set_static(1)
|
||||||
|
|
||||||
if d != None and name != None and type != None:
|
if d is not None and name is not None and type is not None:
|
||||||
self.references[name] = d
|
self.references[name] = d
|
||||||
|
|
||||||
if name == debugsym and not quiet:
|
if name == debugsym and not quiet:
|
||||||
|
@ -239,10 +239,10 @@ class index:
|
||||||
d = identifier(name, header, module, type, lineno, info, extra, conditionals)
|
d = identifier(name, header, module, type, lineno, info, extra, conditionals)
|
||||||
self.identifiers[name] = d
|
self.identifiers[name] = d
|
||||||
|
|
||||||
if d != None and static == 1:
|
if d is not None and static == 1:
|
||||||
d.set_static(1)
|
d.set_static(1)
|
||||||
|
|
||||||
if d != None and name != None and type != None:
|
if d is not None and name is not None and type is not None:
|
||||||
if type == "function":
|
if type == "function":
|
||||||
self.functions[name] = d
|
self.functions[name] = d
|
||||||
elif type == "functype":
|
elif type == "functype":
|
||||||
|
@ -432,7 +432,7 @@ class CLexer:
|
||||||
else:
|
else:
|
||||||
line = self.line
|
line = self.line
|
||||||
self.line = ""
|
self.line = ""
|
||||||
if line == None:
|
if line is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if line[0] == '#':
|
if line[0] == '#':
|
||||||
|
@ -461,7 +461,7 @@ class CLexer:
|
||||||
tok = tok + line
|
tok = tok + line
|
||||||
if found == 0:
|
if found == 0:
|
||||||
line = self.getline()
|
line = self.getline()
|
||||||
if line == None:
|
if line is None:
|
||||||
return None
|
return None
|
||||||
self.last = ('string', tok)
|
self.last = ('string', tok)
|
||||||
return self.last
|
return self.last
|
||||||
|
@ -486,7 +486,7 @@ class CLexer:
|
||||||
tok = tok + line
|
tok = tok + line
|
||||||
if found == 0:
|
if found == 0:
|
||||||
line = self.getline()
|
line = self.getline()
|
||||||
if line == None:
|
if line is None:
|
||||||
return None
|
return None
|
||||||
self.last = ('comment', tok)
|
self.last = ('comment', tok)
|
||||||
return self.last
|
return self.last
|
||||||
|
@ -598,7 +598,7 @@ class CParser:
|
||||||
self.is_header = 0
|
self.is_header = 0
|
||||||
self.input = open(filename)
|
self.input = open(filename)
|
||||||
self.lexer = CLexer(self.input)
|
self.lexer = CLexer(self.input)
|
||||||
if idx == None:
|
if idx is None:
|
||||||
self.index = index()
|
self.index = index()
|
||||||
else:
|
else:
|
||||||
self.index = idx
|
self.index = idx
|
||||||
|
@ -707,7 +707,7 @@ class CParser:
|
||||||
com = token[1]
|
com = token[1]
|
||||||
if self.top_comment == "":
|
if self.top_comment == "":
|
||||||
self.top_comment = com
|
self.top_comment = com
|
||||||
if self.comment == None or com[0] == '*':
|
if self.comment is None or com[0] == '*':
|
||||||
self.comment = com
|
self.comment = com
|
||||||
else:
|
else:
|
||||||
self.comment = self.comment + com
|
self.comment = self.comment + com
|
||||||
|
@ -731,7 +731,7 @@ class CParser:
|
||||||
args = []
|
args = []
|
||||||
desc = ""
|
desc = ""
|
||||||
|
|
||||||
if self.comment == None:
|
if self.comment is None:
|
||||||
if not quiet:
|
if not quiet:
|
||||||
self.warning("Missing comment for type %s" % (name))
|
self.warning("Missing comment for type %s" % (name))
|
||||||
return((args, desc))
|
return((args, desc))
|
||||||
|
@ -780,7 +780,7 @@ class CParser:
|
||||||
args = []
|
args = []
|
||||||
desc = ""
|
desc = ""
|
||||||
|
|
||||||
if self.comment == None:
|
if self.comment is None:
|
||||||
if not quiet:
|
if not quiet:
|
||||||
self.warning("Missing comment for macro %s" % (name))
|
self.warning("Missing comment for macro %s" % (name))
|
||||||
return((args, desc))
|
return((args, desc))
|
||||||
|
@ -860,7 +860,7 @@ class CParser:
|
||||||
desc = ""
|
desc = ""
|
||||||
retdesc = ""
|
retdesc = ""
|
||||||
|
|
||||||
if self.comment == None:
|
if self.comment is None:
|
||||||
if not quiet:
|
if not quiet:
|
||||||
self.warning("Missing comment for function %s" % (name))
|
self.warning("Missing comment for function %s" % (name))
|
||||||
return(((ret[0], retdesc), args, desc))
|
return(((ret[0], retdesc), args, desc))
|
||||||
|
@ -958,7 +958,7 @@ class CParser:
|
||||||
#
|
#
|
||||||
i = 0
|
i = 0
|
||||||
while i < nbargs:
|
while i < nbargs:
|
||||||
if args[i][2] == None and args[i][0] != "void" and args[i][1] != None:
|
if args[i][2] is None and args[i][0] != "void" and args[i][1] is not None:
|
||||||
self.warning("Function comment for %s lacks description of arg %s" % (name, args[i][1]))
|
self.warning("Function comment for %s lacks description of arg %s" % (name, args[i][1]))
|
||||||
i = i + 1
|
i = i + 1
|
||||||
if retdesc == "" and ret[0] != "void":
|
if retdesc == "" and ret[0] != "void":
|
||||||
|
@ -975,7 +975,7 @@ class CParser:
|
||||||
name = token[1]
|
name = token[1]
|
||||||
if name == "#include":
|
if name == "#include":
|
||||||
token = self.lexer.token()
|
token = self.lexer.token()
|
||||||
if token == None:
|
if token is None:
|
||||||
return None
|
return None
|
||||||
if token[0] == 'preproc':
|
if token[0] == 'preproc':
|
||||||
self.index_add(token[1], self.filename, not self.is_header,
|
self.index_add(token[1], self.filename, not self.is_header,
|
||||||
|
@ -984,14 +984,14 @@ class CParser:
|
||||||
return token
|
return token
|
||||||
if name == "#define":
|
if name == "#define":
|
||||||
token = self.lexer.token()
|
token = self.lexer.token()
|
||||||
if token == None:
|
if token is None:
|
||||||
return None
|
return None
|
||||||
if token[0] == 'preproc':
|
if token[0] == 'preproc':
|
||||||
# TODO macros with arguments
|
# TODO macros with arguments
|
||||||
name = token[1]
|
name = token[1]
|
||||||
lst = []
|
lst = []
|
||||||
token = self.lexer.token()
|
token = self.lexer.token()
|
||||||
while token != None and token[0] == 'preproc' and \
|
while token is not None and token[0] == 'preproc' and \
|
||||||
token[1][0] != '#':
|
token[1][0] != '#':
|
||||||
lst.append(token[1])
|
lst.append(token[1])
|
||||||
token = self.lexer.token()
|
token = self.lexer.token()
|
||||||
|
@ -1059,7 +1059,7 @@ class CParser:
|
||||||
self.conditionals = self.conditionals[:-1]
|
self.conditionals = self.conditionals[:-1]
|
||||||
self.defines = self.defines[:-1]
|
self.defines = self.defines[:-1]
|
||||||
token = self.lexer.token()
|
token = self.lexer.token()
|
||||||
while token != None and token[0] == 'preproc' and \
|
while token is not None and token[0] == 'preproc' and \
|
||||||
token[1][0] != '#':
|
token[1][0] != '#':
|
||||||
token = self.lexer.token()
|
token = self.lexer.token()
|
||||||
return token
|
return token
|
||||||
|
@ -1076,7 +1076,7 @@ class CParser:
|
||||||
global ignored_words
|
global ignored_words
|
||||||
|
|
||||||
token = self.lexer.token()
|
token = self.lexer.token()
|
||||||
while token != None:
|
while token is not None:
|
||||||
if token[0] == 'comment':
|
if token[0] == 'comment':
|
||||||
token = self.parseComment(token)
|
token = self.parseComment(token)
|
||||||
continue
|
continue
|
||||||
|
@ -1088,7 +1088,7 @@ class CParser:
|
||||||
return token
|
return token
|
||||||
elif token[0] == "name" and token[1] == "__attribute":
|
elif token[0] == "name" and token[1] == "__attribute":
|
||||||
token = self.lexer.token()
|
token = self.lexer.token()
|
||||||
while token != None and token[1] != ";":
|
while token is not None and token[1] != ";":
|
||||||
token = self.lexer.token()
|
token = self.lexer.token()
|
||||||
return token
|
return token
|
||||||
elif token[0] == "name" and ignored_words.has_key(token[1]):
|
elif token[0] == "name" and ignored_words.has_key(token[1]):
|
||||||
|
@ -1109,20 +1109,20 @@ class CParser:
|
||||||
# Parse a typedef, it records the type and its name.
|
# Parse a typedef, it records the type and its name.
|
||||||
#
|
#
|
||||||
def parseTypedef(self, token):
|
def parseTypedef(self, token):
|
||||||
if token == None:
|
if token is None:
|
||||||
return None
|
return None
|
||||||
token = self.parseType(token)
|
token = self.parseType(token)
|
||||||
if token == None:
|
if token is None:
|
||||||
self.error("parsing typedef")
|
self.error("parsing typedef")
|
||||||
return None
|
return None
|
||||||
base_type = self.type
|
base_type = self.type
|
||||||
type = base_type
|
type = base_type
|
||||||
#self.debug("end typedef type", token)
|
#self.debug("end typedef type", token)
|
||||||
while token != None:
|
while token is not None:
|
||||||
if token[0] == "name":
|
if token[0] == "name":
|
||||||
name = token[1]
|
name = token[1]
|
||||||
signature = self.signature
|
signature = self.signature
|
||||||
if signature != None:
|
if signature is not None:
|
||||||
type = string.split(type, '(')[0]
|
type = string.split(type, '(')[0]
|
||||||
d = self.mergeFunctionComment(name,
|
d = self.mergeFunctionComment(name,
|
||||||
((type, None), signature), 1)
|
((type, None), signature), 1)
|
||||||
|
@ -1143,15 +1143,15 @@ class CParser:
|
||||||
self.error("parsing typedef: expecting a name")
|
self.error("parsing typedef: expecting a name")
|
||||||
return token
|
return token
|
||||||
#self.debug("end typedef", token)
|
#self.debug("end typedef", token)
|
||||||
if token != None and token[0] == 'sep' and token[1] == ',':
|
if token is not None and token[0] == 'sep' and token[1] == ',':
|
||||||
type = base_type
|
type = base_type
|
||||||
token = self.token()
|
token = self.token()
|
||||||
while token != None and token[0] == "op":
|
while token is not None and token[0] == "op":
|
||||||
type = type + token[1]
|
type = type + token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
elif token != None and token[0] == 'sep' and token[1] == ';':
|
elif token is not None and token[0] == 'sep' and token[1] == ';':
|
||||||
break
|
break
|
||||||
elif token != None and token[0] == 'name':
|
elif token is not None and token[0] == 'name':
|
||||||
type = base_type
|
type = base_type
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
|
@ -1165,7 +1165,7 @@ class CParser:
|
||||||
# the balancing } included
|
# the balancing } included
|
||||||
#
|
#
|
||||||
def parseBlock(self, token):
|
def parseBlock(self, token):
|
||||||
while token != None:
|
while token is not None:
|
||||||
if token[0] == "sep" and token[1] == "{":
|
if token[0] == "sep" and token[1] == "{":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.parseBlock(token)
|
token = self.parseBlock(token)
|
||||||
|
@ -1205,7 +1205,7 @@ class CParser:
|
||||||
def parseStruct(self, token):
|
def parseStruct(self, token):
|
||||||
fields = []
|
fields = []
|
||||||
#self.debug("start parseStruct", token)
|
#self.debug("start parseStruct", token)
|
||||||
while token != None:
|
while token is not None:
|
||||||
if token[0] == "sep" and token[1] == "{":
|
if token[0] == "sep" and token[1] == "{":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.parseTypeBlock(token)
|
token = self.parseTypeBlock(token)
|
||||||
|
@ -1220,7 +1220,7 @@ class CParser:
|
||||||
#self.debug("before parseType", token)
|
#self.debug("before parseType", token)
|
||||||
token = self.parseType(token)
|
token = self.parseType(token)
|
||||||
#self.debug("after parseType", token)
|
#self.debug("after parseType", token)
|
||||||
if token != None and token[0] == "name":
|
if token is not None and token[0] == "name":
|
||||||
fname = token[1]
|
fname = token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token[0] == "sep" and token[1] == ";":
|
if token[0] == "sep" and token[1] == ";":
|
||||||
|
@ -1236,12 +1236,12 @@ class CParser:
|
||||||
self.comment = None
|
self.comment = None
|
||||||
else:
|
else:
|
||||||
self.error("parseStruct: expecting ;", token)
|
self.error("parseStruct: expecting ;", token)
|
||||||
elif token != None and token[0] == "sep" and token[1] == "{":
|
elif token is not None and token[0] == "sep" and token[1] == "{":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.parseTypeBlock(token)
|
token = self.parseTypeBlock(token)
|
||||||
if token != None and token[0] == "name":
|
if token is not None and token[0] == "name":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token != None and token[0] == "sep" and token[1] == ";":
|
if token is not None and token[0] == "sep" and token[1] == ";":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
else:
|
else:
|
||||||
self.error("parseStruct: expecting ;", token)
|
self.error("parseStruct: expecting ;", token)
|
||||||
|
@ -1260,7 +1260,7 @@ class CParser:
|
||||||
def parseUnion(self, token):
|
def parseUnion(self, token):
|
||||||
fields = []
|
fields = []
|
||||||
# self.debug("start parseUnion", token)
|
# self.debug("start parseUnion", token)
|
||||||
while token != None:
|
while token is not None:
|
||||||
if token[0] == "sep" and token[1] == "{":
|
if token[0] == "sep" and token[1] == "{":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.parseTypeBlock(token)
|
token = self.parseTypeBlock(token)
|
||||||
|
@ -1275,7 +1275,7 @@ class CParser:
|
||||||
# self.debug("before parseType", token)
|
# self.debug("before parseType", token)
|
||||||
token = self.parseType(token)
|
token = self.parseType(token)
|
||||||
# self.debug("after parseType", token)
|
# self.debug("after parseType", token)
|
||||||
if token != None and token[0] == "name":
|
if token is not None and token[0] == "name":
|
||||||
fname = token[1]
|
fname = token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token[0] == "sep" and token[1] == ";":
|
if token[0] == "sep" and token[1] == ";":
|
||||||
|
@ -1286,12 +1286,12 @@ class CParser:
|
||||||
self.comment = None
|
self.comment = None
|
||||||
else:
|
else:
|
||||||
self.error("parseUnion: expecting ;", token)
|
self.error("parseUnion: expecting ;", token)
|
||||||
elif token != None and token[0] == "sep" and token[1] == "{":
|
elif token is not None and token[0] == "sep" and token[1] == "{":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.parseTypeBlock(token)
|
token = self.parseTypeBlock(token)
|
||||||
if token != None and token[0] == "name":
|
if token is not None and token[0] == "name":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token != None and token[0] == "sep" and token[1] == ";":
|
if token is not None and token[0] == "sep" and token[1] == ";":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
else:
|
else:
|
||||||
self.error("parseUnion: expecting ;", token)
|
self.error("parseUnion: expecting ;", token)
|
||||||
|
@ -1313,14 +1313,14 @@ class CParser:
|
||||||
self.comment = None
|
self.comment = None
|
||||||
comment = ""
|
comment = ""
|
||||||
value = "0"
|
value = "0"
|
||||||
while token != None:
|
while token is not None:
|
||||||
if token[0] == "sep" and token[1] == "{":
|
if token[0] == "sep" and token[1] == "{":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.parseTypeBlock(token)
|
token = self.parseTypeBlock(token)
|
||||||
elif token[0] == "sep" and token[1] == "}":
|
elif token[0] == "sep" and token[1] == "}":
|
||||||
if name != None:
|
if name is not None:
|
||||||
self.cleanupComment()
|
self.cleanupComment()
|
||||||
if self.comment != None:
|
if self.comment is not None:
|
||||||
comment = self.comment
|
comment = self.comment
|
||||||
self.comment = None
|
self.comment = None
|
||||||
self.enums.append((name, value, comment))
|
self.enums.append((name, value, comment))
|
||||||
|
@ -1328,8 +1328,8 @@ class CParser:
|
||||||
return token
|
return token
|
||||||
elif token[0] == "name":
|
elif token[0] == "name":
|
||||||
self.cleanupComment()
|
self.cleanupComment()
|
||||||
if name != None:
|
if name is not None:
|
||||||
if self.comment != None:
|
if self.comment is not None:
|
||||||
comment = string.strip(self.comment)
|
comment = string.strip(self.comment)
|
||||||
self.comment = None
|
self.comment = None
|
||||||
self.enums.append((name, value, comment))
|
self.enums.append((name, value, comment))
|
||||||
|
@ -1451,7 +1451,7 @@ class CParser:
|
||||||
# the balancing }
|
# the balancing }
|
||||||
#
|
#
|
||||||
def parseTypeBlock(self, token):
|
def parseTypeBlock(self, token):
|
||||||
while token != None:
|
while token is not None:
|
||||||
if token[0] == "sep" and token[1] == "{":
|
if token[0] == "sep" and token[1] == "{":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.parseTypeBlock(token)
|
token = self.parseTypeBlock(token)
|
||||||
|
@ -1472,7 +1472,7 @@ class CParser:
|
||||||
self.struct_fields = []
|
self.struct_fields = []
|
||||||
self.union_fields = []
|
self.union_fields = []
|
||||||
self.signature = None
|
self.signature = None
|
||||||
if token == None:
|
if token is None:
|
||||||
return token
|
return token
|
||||||
|
|
||||||
while token[0] == "name" and (
|
while token[0] == "name" and (
|
||||||
|
@ -1524,13 +1524,13 @@ class CParser:
|
||||||
if token[0] == "name":
|
if token[0] == "name":
|
||||||
nametok = token
|
nametok = token
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token != None and token[0] == "sep" and token[1] == "{":
|
if token is not None and token[0] == "sep" and token[1] == "{":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.parseStruct(token)
|
token = self.parseStruct(token)
|
||||||
elif token != None and token[0] == "op" and token[1] == "*":
|
elif token is not None and token[0] == "op" and token[1] == "*":
|
||||||
self.type = self.type + " " + nametok[1] + " *"
|
self.type = self.type + " " + nametok[1] + " *"
|
||||||
token = self.token()
|
token = self.token()
|
||||||
while token != None and token[0] == "op" and token[1] == "*":
|
while token is not None and token[0] == "op" and token[1] == "*":
|
||||||
self.type = self.type + " *"
|
self.type = self.type + " *"
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token[0] == "name":
|
if token[0] == "name":
|
||||||
|
@ -1539,11 +1539,11 @@ class CParser:
|
||||||
else:
|
else:
|
||||||
self.error("struct : expecting name", token)
|
self.error("struct : expecting name", token)
|
||||||
return token
|
return token
|
||||||
elif token != None and token[0] == "name" and nametok != None:
|
elif token is not None and token[0] == "name" and nametok is not None:
|
||||||
self.type = self.type + " " + nametok[1]
|
self.type = self.type + " " + nametok[1]
|
||||||
return token
|
return token
|
||||||
|
|
||||||
if nametok != None:
|
if nametok is not None:
|
||||||
self.lexer.push(token)
|
self.lexer.push(token)
|
||||||
token = nametok
|
token = nametok
|
||||||
return token
|
return token
|
||||||
|
@ -1558,14 +1558,14 @@ class CParser:
|
||||||
if token[0] == "name":
|
if token[0] == "name":
|
||||||
nametok = token
|
nametok = token
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token != None and token[0] == "sep" and token[1] == "{":
|
if token is not None and token[0] == "sep" and token[1] == "{":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.parseUnion(token)
|
token = self.parseUnion(token)
|
||||||
elif token != None and token[0] == "name" and nametok != None:
|
elif token is not None and token[0] == "name" and nametok is not None:
|
||||||
self.type = self.type + " " + nametok[1]
|
self.type = self.type + " " + nametok[1]
|
||||||
return token
|
return token
|
||||||
|
|
||||||
if nametok != None:
|
if nametok is not None:
|
||||||
self.lexer.push(token)
|
self.lexer.push(token)
|
||||||
token = nametok
|
token = nametok
|
||||||
return token
|
return token
|
||||||
|
@ -1577,13 +1577,13 @@ class CParser:
|
||||||
self.type = self.type + " " + token[1]
|
self.type = self.type + " " + token[1]
|
||||||
self.enums = []
|
self.enums = []
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token != None and token[0] == "sep" and token[1] == "{":
|
if token is not None and token[0] == "sep" and token[1] == "{":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.parseEnumBlock(token)
|
token = self.parseEnumBlock(token)
|
||||||
else:
|
else:
|
||||||
self.error("parsing enum: expecting '{'", token)
|
self.error("parsing enum: expecting '{'", token)
|
||||||
enum_type = None
|
enum_type = None
|
||||||
if token != None and token[0] != "name":
|
if token is not None and token[0] != "name":
|
||||||
self.lexer.push(token)
|
self.lexer.push(token)
|
||||||
token = ("name", "enum")
|
token = ("name", "enum")
|
||||||
else:
|
else:
|
||||||
|
@ -1595,24 +1595,24 @@ class CParser:
|
||||||
return token
|
return token
|
||||||
elif token[0] == "name" and token[1] == "VIR_ENUM_DECL":
|
elif token[0] == "name" and token[1] == "VIR_ENUM_DECL":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token != None and token[0] == "sep" and token[1] == "(":
|
if token is not None and token[0] == "sep" and token[1] == "(":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.parseVirEnumDecl(token)
|
token = self.parseVirEnumDecl(token)
|
||||||
else:
|
else:
|
||||||
self.error("parsing VIR_ENUM_DECL: expecting '('", token)
|
self.error("parsing VIR_ENUM_DECL: expecting '('", token)
|
||||||
if token != None:
|
if token is not None:
|
||||||
self.lexer.push(token)
|
self.lexer.push(token)
|
||||||
token = ("name", "virenumdecl")
|
token = ("name", "virenumdecl")
|
||||||
return token
|
return token
|
||||||
|
|
||||||
elif token[0] == "name" and token[1] == "VIR_ENUM_IMPL":
|
elif token[0] == "name" and token[1] == "VIR_ENUM_IMPL":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token != None and token[0] == "sep" and token[1] == "(":
|
if token is not None and token[0] == "sep" and token[1] == "(":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.parseVirEnumImpl(token)
|
token = self.parseVirEnumImpl(token)
|
||||||
else:
|
else:
|
||||||
self.error("parsing VIR_ENUM_IMPL: expecting '('", token)
|
self.error("parsing VIR_ENUM_IMPL: expecting '('", token)
|
||||||
if token != None:
|
if token is not None:
|
||||||
self.lexer.push(token)
|
self.lexer.push(token)
|
||||||
token = ("name", "virenumimpl")
|
token = ("name", "virenumimpl")
|
||||||
return token
|
return token
|
||||||
|
@ -1627,7 +1627,7 @@ class CParser:
|
||||||
token)
|
token)
|
||||||
return token
|
return token
|
||||||
token = self.token()
|
token = self.token()
|
||||||
while token != None and (token[0] == "op" or
|
while token is not None and (token[0] == "op" or
|
||||||
token[0] == "name" and token[1] == "const"):
|
token[0] == "name" and token[1] == "const"):
|
||||||
self.type = self.type + " " + token[1]
|
self.type = self.type + " " + token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
|
@ -1635,22 +1635,22 @@ class CParser:
|
||||||
#
|
#
|
||||||
# if there is a parenthesis here, this means a function type
|
# if there is a parenthesis here, this means a function type
|
||||||
#
|
#
|
||||||
if token != None and token[0] == "sep" and token[1] == '(':
|
if token is not None and token[0] == "sep" and token[1] == '(':
|
||||||
self.type = self.type + token[1]
|
self.type = self.type + token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
while token != None and token[0] == "op" and token[1] == '*':
|
while token is not None and token[0] == "op" and token[1] == '*':
|
||||||
self.type = self.type + token[1]
|
self.type = self.type + token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token == None or token[0] != "name" :
|
if token is None or token[0] != "name" :
|
||||||
self.error("parsing function type, name expected", token)
|
self.error("parsing function type, name expected", token)
|
||||||
return token
|
return token
|
||||||
self.type = self.type + token[1]
|
self.type = self.type + token[1]
|
||||||
nametok = token
|
nametok = token
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token != None and token[0] == "sep" and token[1] == ')':
|
if token is not None and token[0] == "sep" and token[1] == ')':
|
||||||
self.type = self.type + token[1]
|
self.type = self.type + token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token != None and token[0] == "sep" and token[1] == '(':
|
if token is not None and token[0] == "sep" and token[1] == '(':
|
||||||
token = self.token()
|
token = self.token()
|
||||||
type = self.type
|
type = self.type
|
||||||
token = self.parseSignature(token)
|
token = self.parseSignature(token)
|
||||||
|
@ -1668,25 +1668,25 @@ class CParser:
|
||||||
#
|
#
|
||||||
# do some lookahead for arrays
|
# do some lookahead for arrays
|
||||||
#
|
#
|
||||||
if token != None and token[0] == "name":
|
if token is not None and token[0] == "name":
|
||||||
nametok = token
|
nametok = token
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token != None and token[0] == "sep" and token[1] == '[':
|
if token is not None and token[0] == "sep" and token[1] == '[':
|
||||||
self.type = self.type + " " + nametok[1]
|
self.type = self.type + " " + nametok[1]
|
||||||
while token != None and token[0] == "sep" and token[1] == '[':
|
while token is not None and token[0] == "sep" and token[1] == '[':
|
||||||
self.type = self.type + token[1]
|
self.type = self.type + token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
while token != None and token[0] != 'sep' and \
|
while token is not None and token[0] != 'sep' and \
|
||||||
token[1] != ']' and token[1] != ';':
|
token[1] != ']' and token[1] != ';':
|
||||||
self.type = self.type + token[1]
|
self.type = self.type + token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token != None and token[0] == 'sep' and token[1] == ']':
|
if token is not None and token[0] == 'sep' and token[1] == ']':
|
||||||
self.type = self.type + token[1]
|
self.type = self.type + token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
else:
|
else:
|
||||||
self.error("parsing array type, ']' expected", token)
|
self.error("parsing array type, ']' expected", token)
|
||||||
return token
|
return token
|
||||||
elif token != None and token[0] == "sep" and token[1] == ':':
|
elif token is not None and token[0] == "sep" and token[1] == ':':
|
||||||
# remove :12 in case it's a limited int size
|
# remove :12 in case it's a limited int size
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.token()
|
token = self.token()
|
||||||
|
@ -1700,25 +1700,25 @@ class CParser:
|
||||||
# up to the ')' included
|
# up to the ')' included
|
||||||
def parseSignature(self, token):
|
def parseSignature(self, token):
|
||||||
signature = []
|
signature = []
|
||||||
if token != None and token[0] == "sep" and token[1] == ')':
|
if token is not None and token[0] == "sep" and token[1] == ')':
|
||||||
self.signature = []
|
self.signature = []
|
||||||
token = self.token()
|
token = self.token()
|
||||||
return token
|
return token
|
||||||
while token != None:
|
while token is not None:
|
||||||
token = self.parseType(token)
|
token = self.parseType(token)
|
||||||
if token != None and token[0] == "name":
|
if token is not None and token[0] == "name":
|
||||||
signature.append((self.type, token[1], None))
|
signature.append((self.type, token[1], None))
|
||||||
token = self.token()
|
token = self.token()
|
||||||
elif token != None and token[0] == "sep" and token[1] == ',':
|
elif token is not None and token[0] == "sep" and token[1] == ',':
|
||||||
token = self.token()
|
token = self.token()
|
||||||
continue
|
continue
|
||||||
elif token != None and token[0] == "sep" and token[1] == ')':
|
elif token is not None and token[0] == "sep" and token[1] == ')':
|
||||||
# only the type was provided
|
# only the type was provided
|
||||||
if self.type == "...":
|
if self.type == "...":
|
||||||
signature.append((self.type, "...", None))
|
signature.append((self.type, "...", None))
|
||||||
else:
|
else:
|
||||||
signature.append((self.type, None, None))
|
signature.append((self.type, None, None))
|
||||||
if token != None and token[0] == "sep":
|
if token is not None and token[0] == "sep":
|
||||||
if token[1] == ',':
|
if token[1] == ',':
|
||||||
token = self.token()
|
token = self.token()
|
||||||
continue
|
continue
|
||||||
|
@ -1813,17 +1813,17 @@ class CParser:
|
||||||
static = 0
|
static = 0
|
||||||
if token[1] == 'extern':
|
if token[1] == 'extern':
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token == None:
|
if token is None:
|
||||||
return token
|
return token
|
||||||
if token[0] == 'string':
|
if token[0] == 'string':
|
||||||
if token[1] == 'C':
|
if token[1] == 'C':
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token == None:
|
if token is None:
|
||||||
return token
|
return token
|
||||||
if token[0] == 'sep' and token[1] == "{":
|
if token[0] == 'sep' and token[1] == "{":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
# print 'Entering extern "C line ', self.lineno()
|
# print 'Entering extern "C line ', self.lineno()
|
||||||
while token != None and (token[0] != 'sep' or
|
while token is not None and (token[0] != 'sep' or
|
||||||
token[1] != "}"):
|
token[1] != "}"):
|
||||||
if token[0] == 'name':
|
if token[0] == 'name':
|
||||||
token = self.parseGlobal(token)
|
token = self.parseGlobal(token)
|
||||||
|
@ -1840,7 +1840,7 @@ class CParser:
|
||||||
elif token[1] == 'static':
|
elif token[1] == 'static':
|
||||||
static = 1
|
static = 1
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token == None or token[0] != 'name':
|
if token is None or token[0] != 'name':
|
||||||
return token
|
return token
|
||||||
|
|
||||||
if token[1] == 'typedef':
|
if token[1] == 'typedef':
|
||||||
|
@ -1849,22 +1849,22 @@ class CParser:
|
||||||
else:
|
else:
|
||||||
token = self.parseType(token)
|
token = self.parseType(token)
|
||||||
type_orig = self.type
|
type_orig = self.type
|
||||||
if token == None or token[0] != "name":
|
if token is None or token[0] != "name":
|
||||||
return token
|
return token
|
||||||
type = type_orig
|
type = type_orig
|
||||||
self.name = token[1]
|
self.name = token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
while token != None and (token[0] == "sep" or token[0] == "op"):
|
while token is not None and (token[0] == "sep" or token[0] == "op"):
|
||||||
if token[0] == "sep":
|
if token[0] == "sep":
|
||||||
if token[1] == "[":
|
if token[1] == "[":
|
||||||
type = type + token[1]
|
type = type + token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
while token != None and (token[0] != "sep" or \
|
while token is not None and (token[0] != "sep" or \
|
||||||
token[1] != ";"):
|
token[1] != ";"):
|
||||||
type = type + token[1]
|
type = type + token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
|
|
||||||
if token != None and token[0] == "op" and token[1] == "=":
|
if token is not None and token[0] == "op" and token[1] == "=":
|
||||||
#
|
#
|
||||||
# Skip the initialization of the variable
|
# Skip the initialization of the variable
|
||||||
#
|
#
|
||||||
|
@ -1874,15 +1874,15 @@ class CParser:
|
||||||
token = self.parseBlock(token)
|
token = self.parseBlock(token)
|
||||||
else:
|
else:
|
||||||
self.comment = None
|
self.comment = None
|
||||||
while token != None and (token[0] != "sep" or \
|
while token is not None and (token[0] != "sep" or \
|
||||||
(token[1] != ';' and token[1] != ',')):
|
(token[1] != ';' and token[1] != ',')):
|
||||||
token = self.token()
|
token = self.token()
|
||||||
self.comment = None
|
self.comment = None
|
||||||
if token == None or token[0] != "sep" or (token[1] != ';' and
|
if token is None or token[0] != "sep" or (token[1] != ';' and
|
||||||
token[1] != ','):
|
token[1] != ','):
|
||||||
self.error("missing ';' or ',' after value")
|
self.error("missing ';' or ',' after value")
|
||||||
|
|
||||||
if token != None and token[0] == "sep":
|
if token is not None and token[0] == "sep":
|
||||||
if token[1] == ";":
|
if token[1] == ";":
|
||||||
self.comment = None
|
self.comment = None
|
||||||
token = self.token()
|
token = self.token()
|
||||||
|
@ -1897,7 +1897,7 @@ class CParser:
|
||||||
elif token[1] == "(":
|
elif token[1] == "(":
|
||||||
token = self.token()
|
token = self.token()
|
||||||
token = self.parseSignature(token)
|
token = self.parseSignature(token)
|
||||||
if token == None:
|
if token is None:
|
||||||
return None
|
return None
|
||||||
if token[0] == "sep" and token[1] == ";":
|
if token[0] == "sep" and token[1] == ";":
|
||||||
self.checkLongLegacyFunction(self.name, type, self.signature)
|
self.checkLongLegacyFunction(self.name, type, self.signature)
|
||||||
|
@ -1920,10 +1920,10 @@ class CParser:
|
||||||
"variable", type)
|
"variable", type)
|
||||||
type = type_orig
|
type = type_orig
|
||||||
token = self.token()
|
token = self.token()
|
||||||
while token != None and token[0] == "sep":
|
while token is not None and token[0] == "sep":
|
||||||
type = type + token[1]
|
type = type + token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
if token != None and token[0] == "name":
|
if token is not None and token[0] == "name":
|
||||||
self.name = token[1]
|
self.name = token[1]
|
||||||
token = self.token()
|
token = self.token()
|
||||||
else:
|
else:
|
||||||
|
@ -1935,7 +1935,7 @@ class CParser:
|
||||||
if not quiet:
|
if not quiet:
|
||||||
print "Parsing %s" % (self.filename)
|
print "Parsing %s" % (self.filename)
|
||||||
token = self.token()
|
token = self.token()
|
||||||
while token != None:
|
while token is not None:
|
||||||
if token[0] == 'name':
|
if token[0] == 'name':
|
||||||
token = self.parseGlobal(token)
|
token = self.parseGlobal(token)
|
||||||
else:
|
else:
|
||||||
|
@ -1977,7 +1977,7 @@ class docBuilder:
|
||||||
print >>sys.stderr, "Error:", msg
|
print >>sys.stderr, "Error:", msg
|
||||||
|
|
||||||
def indexString(self, id, str):
|
def indexString(self, id, str):
|
||||||
if str == None:
|
if str is None:
|
||||||
return
|
return
|
||||||
str = string.replace(str, "'", ' ')
|
str = string.replace(str, "'", ' ')
|
||||||
str = string.replace(str, '"', ' ')
|
str = string.replace(str, '"', ' ')
|
||||||
|
@ -2069,17 +2069,17 @@ class docBuilder:
|
||||||
id = self.idx.enums[name]
|
id = self.idx.enums[name]
|
||||||
output.write(" <enum name='%s' file='%s'" % (name,
|
output.write(" <enum name='%s' file='%s'" % (name,
|
||||||
self.modulename_file(id.header)))
|
self.modulename_file(id.header)))
|
||||||
if id.info != None:
|
if id.info is not None:
|
||||||
info = id.info
|
info = id.info
|
||||||
if info[0] != None and info[0] != '':
|
if info[0] is not None and info[0] != '':
|
||||||
try:
|
try:
|
||||||
val = eval(info[0])
|
val = eval(info[0])
|
||||||
except:
|
except:
|
||||||
val = info[0]
|
val = info[0]
|
||||||
output.write(" value='%s'" % (val))
|
output.write(" value='%s'" % (val))
|
||||||
if info[2] != None and info[2] != '':
|
if info[2] is not None and info[2] != '':
|
||||||
output.write(" type='%s'" % info[2])
|
output.write(" type='%s'" % info[2])
|
||||||
if info[1] != None and info[1] != '':
|
if info[1] is not None and info[1] != '':
|
||||||
output.write(" info='%s'" % escape(info[1]))
|
output.write(" info='%s'" % escape(info[1]))
|
||||||
output.write("/>\n")
|
output.write("/>\n")
|
||||||
|
|
||||||
|
@ -2087,15 +2087,15 @@ class docBuilder:
|
||||||
id = self.idx.macros[name]
|
id = self.idx.macros[name]
|
||||||
output.write(" <macro name='%s' file='%s'>\n" % (name,
|
output.write(" <macro name='%s' file='%s'>\n" % (name,
|
||||||
self.modulename_file(id.header)))
|
self.modulename_file(id.header)))
|
||||||
if id.info != None:
|
if id.info is not None:
|
||||||
try:
|
try:
|
||||||
(args, desc) = id.info
|
(args, desc) = id.info
|
||||||
if desc != None and desc != "":
|
if desc is not None and desc != "":
|
||||||
output.write(" <info><![CDATA[%s]]></info>\n" % (desc))
|
output.write(" <info><![CDATA[%s]]></info>\n" % (desc))
|
||||||
self.indexString(name, desc)
|
self.indexString(name, desc)
|
||||||
for arg in args:
|
for arg in args:
|
||||||
(name, desc) = arg
|
(name, desc) = arg
|
||||||
if desc != None and desc != "":
|
if desc is not None and desc != "":
|
||||||
output.write(" <arg name='%s' info='%s'/>\n" % (
|
output.write(" <arg name='%s' info='%s'/>\n" % (
|
||||||
name, escape(desc)))
|
name, escape(desc)))
|
||||||
self.indexString(name, desc)
|
self.indexString(name, desc)
|
||||||
|
@ -2110,7 +2110,7 @@ class docBuilder:
|
||||||
output.write(" <union>\n")
|
output.write(" <union>\n")
|
||||||
for f in field[3]:
|
for f in field[3]:
|
||||||
desc = f[2]
|
desc = f[2]
|
||||||
if desc == None:
|
if desc is None:
|
||||||
desc = ''
|
desc = ''
|
||||||
else:
|
else:
|
||||||
desc = escape(desc)
|
desc = escape(desc)
|
||||||
|
@ -2133,7 +2133,7 @@ class docBuilder:
|
||||||
for field in self.idx.structs[name].info:
|
for field in self.idx.structs[name].info:
|
||||||
desc = field[2]
|
desc = field[2]
|
||||||
self.indexString(name, desc)
|
self.indexString(name, desc)
|
||||||
if desc == None:
|
if desc is None:
|
||||||
desc = ''
|
desc = ''
|
||||||
else:
|
else:
|
||||||
desc = escape(desc)
|
desc = escape(desc)
|
||||||
|
@ -2151,7 +2151,7 @@ class docBuilder:
|
||||||
name, self.modulename_file(id.header), id.info))
|
name, self.modulename_file(id.header), id.info))
|
||||||
try:
|
try:
|
||||||
desc = id.extra
|
desc = id.extra
|
||||||
if desc != None and desc != "":
|
if desc is not None and desc != "":
|
||||||
output.write(">\n <info><![CDATA[%s]]></info>\n" % (desc))
|
output.write(">\n <info><![CDATA[%s]]></info>\n" % (desc))
|
||||||
output.write(" </typedef>\n")
|
output.write(" </typedef>\n")
|
||||||
else:
|
else:
|
||||||
|
@ -2161,7 +2161,7 @@ class docBuilder:
|
||||||
|
|
||||||
def serialize_variable(self, output, name):
|
def serialize_variable(self, output, name):
|
||||||
id = self.idx.variables[name]
|
id = self.idx.variables[name]
|
||||||
if id.info != None:
|
if id.info is not None:
|
||||||
output.write(" <variable name='%s' file='%s' type='%s'/>\n" % (
|
output.write(" <variable name='%s' file='%s' type='%s'/>\n" % (
|
||||||
name, self.modulename_file(id.header), id.info))
|
name, self.modulename_file(id.header), id.info))
|
||||||
else:
|
else:
|
||||||
|
@ -2179,7 +2179,7 @@ class docBuilder:
|
||||||
#
|
#
|
||||||
# Processing of conditionals modified by Bill 1/1/05
|
# Processing of conditionals modified by Bill 1/1/05
|
||||||
#
|
#
|
||||||
if id.conditionals != None:
|
if id.conditionals is not None:
|
||||||
apstr = ""
|
apstr = ""
|
||||||
for cond in id.conditionals:
|
for cond in id.conditionals:
|
||||||
if apstr != "":
|
if apstr != "":
|
||||||
|
@ -2190,10 +2190,10 @@ class docBuilder:
|
||||||
(ret, params, desc) = id.info
|
(ret, params, desc) = id.info
|
||||||
output.write(" <info><![CDATA[%s]]></info>\n" % (desc))
|
output.write(" <info><![CDATA[%s]]></info>\n" % (desc))
|
||||||
self.indexString(name, desc)
|
self.indexString(name, desc)
|
||||||
if ret[0] != None:
|
if ret[0] is not None:
|
||||||
if ret[0] == "void":
|
if ret[0] == "void":
|
||||||
output.write(" <return type='void'/>\n")
|
output.write(" <return type='void'/>\n")
|
||||||
elif (ret[1] == None or ret[1] == '') and not ignored_functions.has_key(name):
|
elif (ret[1] is None or ret[1] == '') and not ignored_functions.has_key(name):
|
||||||
self.error("Missing documentation for return of function `%s'" % name)
|
self.error("Missing documentation for return of function `%s'" % name)
|
||||||
else:
|
else:
|
||||||
output.write(" <return type='%s' info='%s'/>\n" % (
|
output.write(" <return type='%s' info='%s'/>\n" % (
|
||||||
|
@ -2202,7 +2202,7 @@ class docBuilder:
|
||||||
for param in params:
|
for param in params:
|
||||||
if param[0] == 'void':
|
if param[0] == 'void':
|
||||||
continue
|
continue
|
||||||
if (param[2] == None or param[2] == ''):
|
if (param[2] is None or param[2] == ''):
|
||||||
if ignored_functions.has_key(name):
|
if ignored_functions.has_key(name):
|
||||||
output.write(" <arg name='%s' type='%s' info=''/>\n" % (param[1], param[0]))
|
output.write(" <arg name='%s' type='%s' info=''/>\n" % (param[1], param[0]))
|
||||||
else:
|
else:
|
||||||
|
@ -2219,7 +2219,7 @@ class docBuilder:
|
||||||
module = self.modulename_file(file)
|
module = self.modulename_file(file)
|
||||||
output.write(" <file name='%s'>\n" % (module))
|
output.write(" <file name='%s'>\n" % (module))
|
||||||
dict = self.headers[file]
|
dict = self.headers[file]
|
||||||
if dict.info != None:
|
if dict.info is not None:
|
||||||
for data in ('Summary', 'Description', 'Author'):
|
for data in ('Summary', 'Description', 'Author'):
|
||||||
try:
|
try:
|
||||||
output.write(" <%s>%s</%s>\n" % (
|
output.write(" <%s>%s</%s>\n" % (
|
||||||
|
@ -2352,12 +2352,12 @@ class docBuilder:
|
||||||
ids.sort()
|
ids.sort()
|
||||||
for id in ids:
|
for id in ids:
|
||||||
if id[0] != letter:
|
if id[0] != letter:
|
||||||
if letter != None:
|
if letter is not None:
|
||||||
output.write(" </letter>\n")
|
output.write(" </letter>\n")
|
||||||
letter = id[0]
|
letter = id[0]
|
||||||
output.write(" <letter name='%s'>\n" % (letter))
|
output.write(" <letter name='%s'>\n" % (letter))
|
||||||
output.write(" <ref name='%s'/>\n" % (id))
|
output.write(" <ref name='%s'/>\n" % (id))
|
||||||
if letter != None:
|
if letter is not None:
|
||||||
output.write(" </letter>\n")
|
output.write(" </letter>\n")
|
||||||
|
|
||||||
def serialize_xrefs_references(self, output):
|
def serialize_xrefs_references(self, output):
|
||||||
|
@ -2383,8 +2383,8 @@ class docBuilder:
|
||||||
if len(index[id]) > 30:
|
if len(index[id]) > 30:
|
||||||
continue
|
continue
|
||||||
if id[0] != letter:
|
if id[0] != letter:
|
||||||
if letter == None or count > 200:
|
if letter is None or count > 200:
|
||||||
if letter != None:
|
if letter is not None:
|
||||||
output.write(" </letter>\n")
|
output.write(" </letter>\n")
|
||||||
output.write(" </chunk>\n")
|
output.write(" </chunk>\n")
|
||||||
count = 0
|
count = 0
|
||||||
|
@ -2392,7 +2392,7 @@ class docBuilder:
|
||||||
output.write(" <chunk name='chunk%s'>\n" % (chunk))
|
output.write(" <chunk name='chunk%s'>\n" % (chunk))
|
||||||
first_letter = id[0]
|
first_letter = id[0]
|
||||||
chunk = chunk + 1
|
chunk = chunk + 1
|
||||||
elif letter != None:
|
elif letter is not None:
|
||||||
output.write(" </letter>\n")
|
output.write(" </letter>\n")
|
||||||
letter = id[0]
|
letter = id[0]
|
||||||
output.write(" <letter name='%s'>\n" % (letter))
|
output.write(" <letter name='%s'>\n" % (letter))
|
||||||
|
@ -2407,7 +2407,7 @@ class docBuilder:
|
||||||
output.write(" <ref name='%s'/>\n" % (token))
|
output.write(" <ref name='%s'/>\n" % (token))
|
||||||
count = count + 1
|
count = count + 1
|
||||||
output.write(" </word>\n")
|
output.write(" </word>\n")
|
||||||
if letter != None:
|
if letter is not None:
|
||||||
output.write(" </letter>\n")
|
output.write(" </letter>\n")
|
||||||
output.write(" </chunk>\n")
|
output.write(" </chunk>\n")
|
||||||
if count != 0:
|
if count != 0:
|
||||||
|
|
178
docs/index.py
178
docs/index.py
|
@ -127,9 +127,9 @@ DB=None
|
||||||
def createTable(db, name):
|
def createTable(db, name):
|
||||||
global TABLES
|
global TABLES
|
||||||
|
|
||||||
if db == None:
|
if db is None:
|
||||||
return -1
|
return -1
|
||||||
if name == None:
|
if name is None:
|
||||||
return -1
|
return -1
|
||||||
c = db.cursor()
|
c = db.cursor()
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ def createTable(db, name):
|
||||||
def checkTables(db, verbose = 1):
|
def checkTables(db, verbose = 1):
|
||||||
global TABLES
|
global TABLES
|
||||||
|
|
||||||
if db == None:
|
if db is None:
|
||||||
return -1
|
return -1
|
||||||
c = db.cursor()
|
c = db.cursor()
|
||||||
nbtables = c.execute("show tables")
|
nbtables = c.execute("show tables")
|
||||||
|
@ -191,7 +191,7 @@ def checkTables(db, verbose = 1):
|
||||||
def openMySQL(db="libvir", passwd=None, verbose = 1):
|
def openMySQL(db="libvir", passwd=None, verbose = 1):
|
||||||
global DB
|
global DB
|
||||||
|
|
||||||
if passwd == None:
|
if passwd is None:
|
||||||
try:
|
try:
|
||||||
passwd = os.environ["MySQL_PASS"]
|
passwd = os.environ["MySQL_PASS"]
|
||||||
except:
|
except:
|
||||||
|
@ -199,7 +199,7 @@ def openMySQL(db="libvir", passwd=None, verbose = 1):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
DB = MySQLdb.connect(passwd=passwd, db=db)
|
DB = MySQLdb.connect(passwd=passwd, db=db)
|
||||||
if DB == None:
|
if DB is None:
|
||||||
return -1
|
return -1
|
||||||
ret = checkTables(DB, verbose)
|
ret = checkTables(DB, verbose)
|
||||||
return ret
|
return ret
|
||||||
|
@ -207,13 +207,13 @@ def openMySQL(db="libvir", passwd=None, verbose = 1):
|
||||||
def updateWord(name, symbol, relevance):
|
def updateWord(name, symbol, relevance):
|
||||||
global DB
|
global DB
|
||||||
|
|
||||||
if DB == None:
|
if DB is None:
|
||||||
openMySQL()
|
openMySQL()
|
||||||
if DB == None:
|
if DB is None:
|
||||||
return -1
|
return -1
|
||||||
if name == None:
|
if name is None:
|
||||||
return -1
|
return -1
|
||||||
if symbol == None:
|
if symbol is None:
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
c = DB.cursor()
|
c = DB.cursor()
|
||||||
|
@ -238,15 +238,15 @@ def updateSymbol(name, module, type, desc):
|
||||||
global DB
|
global DB
|
||||||
|
|
||||||
updateWord(name, name, 50)
|
updateWord(name, name, 50)
|
||||||
if DB == None:
|
if DB is None:
|
||||||
openMySQL()
|
openMySQL()
|
||||||
if DB == None:
|
if DB is None:
|
||||||
return -1
|
return -1
|
||||||
if name == None:
|
if name is None:
|
||||||
return -1
|
return -1
|
||||||
if module == None:
|
if module is None:
|
||||||
return -1
|
return -1
|
||||||
if type == None:
|
if type is None:
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -299,11 +299,11 @@ def addFunctype(name, module, desc = ""):
|
||||||
def addPage(resource, title):
|
def addPage(resource, title):
|
||||||
global DB
|
global DB
|
||||||
|
|
||||||
if DB == None:
|
if DB is None:
|
||||||
openMySQL()
|
openMySQL()
|
||||||
if DB == None:
|
if DB is None:
|
||||||
return -1
|
return -1
|
||||||
if resource == None:
|
if resource is None:
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
c = DB.cursor()
|
c = DB.cursor()
|
||||||
|
@ -327,17 +327,17 @@ def addPage(resource, title):
|
||||||
def updateWordHTML(name, resource, desc, id, relevance):
|
def updateWordHTML(name, resource, desc, id, relevance):
|
||||||
global DB
|
global DB
|
||||||
|
|
||||||
if DB == None:
|
if DB is None:
|
||||||
openMySQL()
|
openMySQL()
|
||||||
if DB == None:
|
if DB is None:
|
||||||
return -1
|
return -1
|
||||||
if name == None:
|
if name is None:
|
||||||
return -1
|
return -1
|
||||||
if resource == None:
|
if resource is None:
|
||||||
return -1
|
return -1
|
||||||
if id == None:
|
if id is None:
|
||||||
id = ""
|
id = ""
|
||||||
if desc == None:
|
if desc is None:
|
||||||
desc = ""
|
desc = ""
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
@ -367,11 +367,11 @@ def updateWordHTML(name, resource, desc, id, relevance):
|
||||||
def checkXMLMsgArchive(url):
|
def checkXMLMsgArchive(url):
|
||||||
global DB
|
global DB
|
||||||
|
|
||||||
if DB == None:
|
if DB is None:
|
||||||
openMySQL()
|
openMySQL()
|
||||||
if DB == None:
|
if DB is None:
|
||||||
return -1
|
return -1
|
||||||
if url == None:
|
if url is None:
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
c = DB.cursor()
|
c = DB.cursor()
|
||||||
|
@ -379,7 +379,7 @@ def checkXMLMsgArchive(url):
|
||||||
ret = c.execute(
|
ret = c.execute(
|
||||||
"""SELECT ID FROM archives WHERE resource='%s'""" % (url))
|
"""SELECT ID FROM archives WHERE resource='%s'""" % (url))
|
||||||
row = c.fetchone()
|
row = c.fetchone()
|
||||||
if row == None:
|
if row is None:
|
||||||
return -1
|
return -1
|
||||||
except:
|
except:
|
||||||
return -1
|
return -1
|
||||||
|
@ -389,13 +389,13 @@ def checkXMLMsgArchive(url):
|
||||||
def addXMLMsgArchive(url, title):
|
def addXMLMsgArchive(url, title):
|
||||||
global DB
|
global DB
|
||||||
|
|
||||||
if DB == None:
|
if DB is None:
|
||||||
openMySQL()
|
openMySQL()
|
||||||
if DB == None:
|
if DB is None:
|
||||||
return -1
|
return -1
|
||||||
if url == None:
|
if url is None:
|
||||||
return -1
|
return -1
|
||||||
if title == None:
|
if title is None:
|
||||||
title = ""
|
title = ""
|
||||||
else:
|
else:
|
||||||
title = string.replace(title, "'", " ")
|
title = string.replace(title, "'", " ")
|
||||||
|
@ -408,7 +408,7 @@ def addXMLMsgArchive(url, title):
|
||||||
cmd = """SELECT ID FROM archives WHERE resource='%s'""" % (url)
|
cmd = """SELECT ID FROM archives WHERE resource='%s'""" % (url)
|
||||||
ret = c.execute(cmd)
|
ret = c.execute(cmd)
|
||||||
row = c.fetchone()
|
row = c.fetchone()
|
||||||
if row == None:
|
if row is None:
|
||||||
print "addXMLMsgArchive failed to get the ID: %s" % (url)
|
print "addXMLMsgArchive failed to get the ID: %s" % (url)
|
||||||
return -1
|
return -1
|
||||||
except:
|
except:
|
||||||
|
@ -420,13 +420,13 @@ def addXMLMsgArchive(url, title):
|
||||||
def updateWordArchive(name, id, relevance):
|
def updateWordArchive(name, id, relevance):
|
||||||
global DB
|
global DB
|
||||||
|
|
||||||
if DB == None:
|
if DB is None:
|
||||||
openMySQL()
|
openMySQL()
|
||||||
if DB == None:
|
if DB is None:
|
||||||
return -1
|
return -1
|
||||||
if name == None:
|
if name is None:
|
||||||
return -1
|
return -1
|
||||||
if id == None:
|
if id is None:
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
c = DB.cursor()
|
c = DB.cursor()
|
||||||
|
@ -533,9 +533,9 @@ def splitIdentifier(str):
|
||||||
def addWord(word, module, symbol, relevance):
|
def addWord(word, module, symbol, relevance):
|
||||||
global wordsDict
|
global wordsDict
|
||||||
|
|
||||||
if word == None or len(word) < 3:
|
if word is None or len(word) < 3:
|
||||||
return -1
|
return -1
|
||||||
if module == None or symbol == None:
|
if module is None or symbol is None:
|
||||||
return -1
|
return -1
|
||||||
if dropWords.has_key(word):
|
if dropWords.has_key(word):
|
||||||
return 0
|
return 0
|
||||||
|
@ -544,7 +544,7 @@ def addWord(word, module, symbol, relevance):
|
||||||
|
|
||||||
if wordsDict.has_key(word):
|
if wordsDict.has_key(word):
|
||||||
d = wordsDict[word]
|
d = wordsDict[word]
|
||||||
if d == None:
|
if d is None:
|
||||||
return 0
|
return 0
|
||||||
if len(d) > 500:
|
if len(d) > 500:
|
||||||
wordsDict[word] = None
|
wordsDict[word] = None
|
||||||
|
@ -559,7 +559,7 @@ def addWord(word, module, symbol, relevance):
|
||||||
return relevance
|
return relevance
|
||||||
|
|
||||||
def addString(str, module, symbol, relevance):
|
def addString(str, module, symbol, relevance):
|
||||||
if str == None or len(str) < 3:
|
if str is None or len(str) < 3:
|
||||||
return -1
|
return -1
|
||||||
ret = 0
|
ret = 0
|
||||||
str = cleanupWordsString(str)
|
str = cleanupWordsString(str)
|
||||||
|
@ -573,9 +573,9 @@ def addString(str, module, symbol, relevance):
|
||||||
def addWordHTML(word, resource, id, section, relevance):
|
def addWordHTML(word, resource, id, section, relevance):
|
||||||
global wordsDictHTML
|
global wordsDictHTML
|
||||||
|
|
||||||
if word == None or len(word) < 3:
|
if word is None or len(word) < 3:
|
||||||
return -1
|
return -1
|
||||||
if resource == None or section == None:
|
if resource is None or section is None:
|
||||||
return -1
|
return -1
|
||||||
if dropWords.has_key(word):
|
if dropWords.has_key(word):
|
||||||
return 0
|
return 0
|
||||||
|
@ -586,14 +586,14 @@ def addWordHTML(word, resource, id, section, relevance):
|
||||||
|
|
||||||
if wordsDictHTML.has_key(word):
|
if wordsDictHTML.has_key(word):
|
||||||
d = wordsDictHTML[word]
|
d = wordsDictHTML[word]
|
||||||
if d == None:
|
if d is None:
|
||||||
print "skipped %s" % (word)
|
print "skipped %s" % (word)
|
||||||
return 0
|
return 0
|
||||||
try:
|
try:
|
||||||
(r,i,s) = d[resource]
|
(r,i,s) = d[resource]
|
||||||
if i != None:
|
if i is not None:
|
||||||
id = i
|
id = i
|
||||||
if s != None:
|
if s is not None:
|
||||||
section = s
|
section = s
|
||||||
relevance = relevance + r
|
relevance = relevance + r
|
||||||
except:
|
except:
|
||||||
|
@ -605,7 +605,7 @@ def addWordHTML(word, resource, id, section, relevance):
|
||||||
return relevance
|
return relevance
|
||||||
|
|
||||||
def addStringHTML(str, resource, id, section, relevance):
|
def addStringHTML(str, resource, id, section, relevance):
|
||||||
if str == None or len(str) < 3:
|
if str is None or len(str) < 3:
|
||||||
return -1
|
return -1
|
||||||
ret = 0
|
ret = 0
|
||||||
str = cleanupWordsString(str)
|
str = cleanupWordsString(str)
|
||||||
|
@ -626,9 +626,9 @@ def addStringHTML(str, resource, id, section, relevance):
|
||||||
def addWordArchive(word, id, relevance):
|
def addWordArchive(word, id, relevance):
|
||||||
global wordsDictArchive
|
global wordsDictArchive
|
||||||
|
|
||||||
if word == None or len(word) < 3:
|
if word is None or len(word) < 3:
|
||||||
return -1
|
return -1
|
||||||
if id == None or id == -1:
|
if id is None or id == -1:
|
||||||
return -1
|
return -1
|
||||||
if dropWords.has_key(word):
|
if dropWords.has_key(word):
|
||||||
return 0
|
return 0
|
||||||
|
@ -637,7 +637,7 @@ def addWordArchive(word, id, relevance):
|
||||||
|
|
||||||
if wordsDictArchive.has_key(word):
|
if wordsDictArchive.has_key(word):
|
||||||
d = wordsDictArchive[word]
|
d = wordsDictArchive[word]
|
||||||
if d == None:
|
if d is None:
|
||||||
print "skipped %s" % (word)
|
print "skipped %s" % (word)
|
||||||
return 0
|
return 0
|
||||||
try:
|
try:
|
||||||
|
@ -652,7 +652,7 @@ def addWordArchive(word, id, relevance):
|
||||||
return relevance
|
return relevance
|
||||||
|
|
||||||
def addStringArchive(str, id, relevance):
|
def addStringArchive(str, id, relevance):
|
||||||
if str == None or len(str) < 3:
|
if str is None or len(str) < 3:
|
||||||
return -1
|
return -1
|
||||||
ret = 0
|
ret = 0
|
||||||
str = cleanupWordsString(str)
|
str = cleanupWordsString(str)
|
||||||
|
@ -683,9 +683,9 @@ def loadAPI(filename):
|
||||||
return doc
|
return doc
|
||||||
|
|
||||||
def foundExport(file, symbol):
|
def foundExport(file, symbol):
|
||||||
if file == None:
|
if file is None:
|
||||||
return 0
|
return 0
|
||||||
if symbol == None:
|
if symbol is None:
|
||||||
return 0
|
return 0
|
||||||
addFunction(symbol, file)
|
addFunction(symbol, file)
|
||||||
l = splitIdentifier(symbol)
|
l = splitIdentifier(symbol)
|
||||||
|
@ -697,7 +697,7 @@ def analyzeAPIFile(top):
|
||||||
count = 0
|
count = 0
|
||||||
name = top.prop("name")
|
name = top.prop("name")
|
||||||
cur = top.children
|
cur = top.children
|
||||||
while cur != None:
|
while cur is not None:
|
||||||
if cur.type == 'text':
|
if cur.type == 'text':
|
||||||
cur = cur.next
|
cur = cur.next
|
||||||
continue
|
continue
|
||||||
|
@ -712,7 +712,7 @@ def analyzeAPIFiles(top):
|
||||||
count = 0
|
count = 0
|
||||||
cur = top.children
|
cur = top.children
|
||||||
|
|
||||||
while cur != None:
|
while cur is not None:
|
||||||
if cur.type == 'text':
|
if cur.type == 'text':
|
||||||
cur = cur.next
|
cur = cur.next
|
||||||
continue
|
continue
|
||||||
|
@ -725,10 +725,10 @@ def analyzeAPIFiles(top):
|
||||||
|
|
||||||
def analyzeAPIEnum(top):
|
def analyzeAPIEnum(top):
|
||||||
file = top.prop("file")
|
file = top.prop("file")
|
||||||
if file == None:
|
if file is None:
|
||||||
return 0
|
return 0
|
||||||
symbol = top.prop("name")
|
symbol = top.prop("name")
|
||||||
if symbol == None:
|
if symbol is None:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
addEnum(symbol, file)
|
addEnum(symbol, file)
|
||||||
|
@ -740,10 +740,10 @@ def analyzeAPIEnum(top):
|
||||||
|
|
||||||
def analyzeAPIConst(top):
|
def analyzeAPIConst(top):
|
||||||
file = top.prop("file")
|
file = top.prop("file")
|
||||||
if file == None:
|
if file is None:
|
||||||
return 0
|
return 0
|
||||||
symbol = top.prop("name")
|
symbol = top.prop("name")
|
||||||
if symbol == None:
|
if symbol is None:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
addConst(symbol, file)
|
addConst(symbol, file)
|
||||||
|
@ -755,10 +755,10 @@ def analyzeAPIConst(top):
|
||||||
|
|
||||||
def analyzeAPIType(top):
|
def analyzeAPIType(top):
|
||||||
file = top.prop("file")
|
file = top.prop("file")
|
||||||
if file == None:
|
if file is None:
|
||||||
return 0
|
return 0
|
||||||
symbol = top.prop("name")
|
symbol = top.prop("name")
|
||||||
if symbol == None:
|
if symbol is None:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
addType(symbol, file)
|
addType(symbol, file)
|
||||||
|
@ -769,10 +769,10 @@ def analyzeAPIType(top):
|
||||||
|
|
||||||
def analyzeAPIFunctype(top):
|
def analyzeAPIFunctype(top):
|
||||||
file = top.prop("file")
|
file = top.prop("file")
|
||||||
if file == None:
|
if file is None:
|
||||||
return 0
|
return 0
|
||||||
symbol = top.prop("name")
|
symbol = top.prop("name")
|
||||||
if symbol == None:
|
if symbol is None:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
addFunctype(symbol, file)
|
addFunctype(symbol, file)
|
||||||
|
@ -783,10 +783,10 @@ def analyzeAPIFunctype(top):
|
||||||
|
|
||||||
def analyzeAPIStruct(top):
|
def analyzeAPIStruct(top):
|
||||||
file = top.prop("file")
|
file = top.prop("file")
|
||||||
if file == None:
|
if file is None:
|
||||||
return 0
|
return 0
|
||||||
symbol = top.prop("name")
|
symbol = top.prop("name")
|
||||||
if symbol == None:
|
if symbol is None:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
addStruct(symbol, file)
|
addStruct(symbol, file)
|
||||||
|
@ -795,7 +795,7 @@ def analyzeAPIStruct(top):
|
||||||
addWord(word, file, symbol, 10)
|
addWord(word, file, symbol, 10)
|
||||||
|
|
||||||
info = top.prop("info")
|
info = top.prop("info")
|
||||||
if info != None:
|
if info is not None:
|
||||||
info = string.replace(info, "'", " ")
|
info = string.replace(info, "'", " ")
|
||||||
info = string.strip(info)
|
info = string.strip(info)
|
||||||
l = string.split(info)
|
l = string.split(info)
|
||||||
|
@ -806,17 +806,17 @@ def analyzeAPIStruct(top):
|
||||||
|
|
||||||
def analyzeAPIMacro(top):
|
def analyzeAPIMacro(top):
|
||||||
file = top.prop("file")
|
file = top.prop("file")
|
||||||
if file == None:
|
if file is None:
|
||||||
return 0
|
return 0
|
||||||
symbol = top.prop("name")
|
symbol = top.prop("name")
|
||||||
if symbol == None:
|
if symbol is None:
|
||||||
return 0
|
return 0
|
||||||
symbol = string.replace(symbol, "'", " ")
|
symbol = string.replace(symbol, "'", " ")
|
||||||
symbol = string.strip(symbol)
|
symbol = string.strip(symbol)
|
||||||
|
|
||||||
info = None
|
info = None
|
||||||
cur = top.children
|
cur = top.children
|
||||||
while cur != None:
|
while cur is not None:
|
||||||
if cur.type == 'text':
|
if cur.type == 'text':
|
||||||
cur = cur.next
|
cur = cur.next
|
||||||
continue
|
continue
|
||||||
|
@ -829,7 +829,7 @@ def analyzeAPIMacro(top):
|
||||||
for word in l:
|
for word in l:
|
||||||
addWord(word, file, symbol, 10)
|
addWord(word, file, symbol, 10)
|
||||||
|
|
||||||
if info == None:
|
if info is None:
|
||||||
addMacro(symbol, file)
|
addMacro(symbol, file)
|
||||||
print "Macro %s description has no <info>" % (symbol)
|
print "Macro %s description has no <info>" % (symbol)
|
||||||
return 0
|
return 0
|
||||||
|
@ -845,17 +845,17 @@ def analyzeAPIMacro(top):
|
||||||
|
|
||||||
def analyzeAPIFunction(top):
|
def analyzeAPIFunction(top):
|
||||||
file = top.prop("file")
|
file = top.prop("file")
|
||||||
if file == None:
|
if file is None:
|
||||||
return 0
|
return 0
|
||||||
symbol = top.prop("name")
|
symbol = top.prop("name")
|
||||||
if symbol == None:
|
if symbol is None:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
symbol = string.replace(symbol, "'", " ")
|
symbol = string.replace(symbol, "'", " ")
|
||||||
symbol = string.strip(symbol)
|
symbol = string.strip(symbol)
|
||||||
info = None
|
info = None
|
||||||
cur = top.children
|
cur = top.children
|
||||||
while cur != None:
|
while cur is not None:
|
||||||
if cur.type == 'text':
|
if cur.type == 'text':
|
||||||
cur = cur.next
|
cur = cur.next
|
||||||
continue
|
continue
|
||||||
|
@ -863,23 +863,23 @@ def analyzeAPIFunction(top):
|
||||||
info = cur.content
|
info = cur.content
|
||||||
elif cur.name == "return":
|
elif cur.name == "return":
|
||||||
rinfo = cur.prop("info")
|
rinfo = cur.prop("info")
|
||||||
if rinfo != None:
|
if rinfo is not None:
|
||||||
rinfo = string.replace(rinfo, "'", " ")
|
rinfo = string.replace(rinfo, "'", " ")
|
||||||
rinfo = string.strip(rinfo)
|
rinfo = string.strip(rinfo)
|
||||||
addString(rinfo, file, symbol, 7)
|
addString(rinfo, file, symbol, 7)
|
||||||
elif cur.name == "arg":
|
elif cur.name == "arg":
|
||||||
ainfo = cur.prop("info")
|
ainfo = cur.prop("info")
|
||||||
if ainfo != None:
|
if ainfo is not None:
|
||||||
ainfo = string.replace(ainfo, "'", " ")
|
ainfo = string.replace(ainfo, "'", " ")
|
||||||
ainfo = string.strip(ainfo)
|
ainfo = string.strip(ainfo)
|
||||||
addString(ainfo, file, symbol, 5)
|
addString(ainfo, file, symbol, 5)
|
||||||
name = cur.prop("name")
|
name = cur.prop("name")
|
||||||
if name != None:
|
if name is not None:
|
||||||
name = string.replace(name, "'", " ")
|
name = string.replace(name, "'", " ")
|
||||||
name = string.strip(name)
|
name = string.strip(name)
|
||||||
addWord(name, file, symbol, 7)
|
addWord(name, file, symbol, 7)
|
||||||
cur = cur.next
|
cur = cur.next
|
||||||
if info == None:
|
if info is None:
|
||||||
print "Function %s description has no <info>" % (symbol)
|
print "Function %s description has no <info>" % (symbol)
|
||||||
addFunction(symbol, file, "")
|
addFunction(symbol, file, "")
|
||||||
else:
|
else:
|
||||||
|
@ -898,7 +898,7 @@ def analyzeAPISymbols(top):
|
||||||
count = 0
|
count = 0
|
||||||
cur = top.children
|
cur = top.children
|
||||||
|
|
||||||
while cur != None:
|
while cur is not None:
|
||||||
if cur.type == 'text':
|
if cur.type == 'text':
|
||||||
cur = cur.next
|
cur = cur.next
|
||||||
continue
|
continue
|
||||||
|
@ -923,14 +923,14 @@ def analyzeAPISymbols(top):
|
||||||
|
|
||||||
def analyzeAPI(doc):
|
def analyzeAPI(doc):
|
||||||
count = 0
|
count = 0
|
||||||
if doc == None:
|
if doc is None:
|
||||||
return -1
|
return -1
|
||||||
root = doc.getRootElement()
|
root = doc.getRootElement()
|
||||||
if root.name != "api":
|
if root.name != "api":
|
||||||
print "Unexpected root name"
|
print "Unexpected root name"
|
||||||
return -1
|
return -1
|
||||||
cur = root.children
|
cur = root.children
|
||||||
while cur != None:
|
while cur is not None:
|
||||||
if cur.type == 'text':
|
if cur.type == 'text':
|
||||||
cur = cur.next
|
cur = cur.next
|
||||||
continue
|
continue
|
||||||
|
@ -1056,7 +1056,7 @@ def analyzeHTMLPages():
|
||||||
import time
|
import time
|
||||||
|
|
||||||
def getXMLDateArchive(t = None):
|
def getXMLDateArchive(t = None):
|
||||||
if t == None:
|
if t is None:
|
||||||
t = time.time()
|
t = time.time()
|
||||||
T = time.gmtime(t)
|
T = time.gmtime(t)
|
||||||
month = time.strftime("%B", T)
|
month = time.strftime("%B", T)
|
||||||
|
@ -1065,7 +1065,7 @@ def getXMLDateArchive(t = None):
|
||||||
return url
|
return url
|
||||||
|
|
||||||
def scanXMLMsgArchive(url, title, force = 0):
|
def scanXMLMsgArchive(url, title, force = 0):
|
||||||
if url == None or title == None:
|
if url is None or title is None:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
ID = checkXMLMsgArchive(url)
|
ID = checkXMLMsgArchive(url)
|
||||||
|
@ -1082,7 +1082,7 @@ def scanXMLMsgArchive(url, title, force = 0):
|
||||||
doc = libxml2.htmlParseFile(url, None)
|
doc = libxml2.htmlParseFile(url, None)
|
||||||
except:
|
except:
|
||||||
doc = None
|
doc = None
|
||||||
if doc == None:
|
if doc is None:
|
||||||
print "Failed to parse %s" % (url)
|
print "Failed to parse %s" % (url)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
@ -1105,7 +1105,7 @@ def scanXMLDateArchive(t = None, force = 0):
|
||||||
doc = libxml2.htmlParseFile(url, None)
|
doc = libxml2.htmlParseFile(url, None)
|
||||||
except:
|
except:
|
||||||
doc = None
|
doc = None
|
||||||
if doc == None:
|
if doc is None:
|
||||||
print "Failed to parse %s" % (url)
|
print "Failed to parse %s" % (url)
|
||||||
return -1
|
return -1
|
||||||
ctxt = doc.xpathNewContext()
|
ctxt = doc.xpathNewContext()
|
||||||
|
@ -1114,16 +1114,16 @@ def scanXMLDateArchive(t = None, force = 0):
|
||||||
newmsg = 0
|
newmsg = 0
|
||||||
for anchor in anchors:
|
for anchor in anchors:
|
||||||
href = anchor.prop("href")
|
href = anchor.prop("href")
|
||||||
if href == None or href[0:3] != "msg":
|
if href is None or href[0:3] != "msg":
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
links = links + 1
|
links = links + 1
|
||||||
|
|
||||||
msg = libxml2.buildURI(href, url)
|
msg = libxml2.buildURI(href, url)
|
||||||
title = anchor.content
|
title = anchor.content
|
||||||
if title != None and title[0:4] == 'Re: ':
|
if title is not None and title[0:4] == 'Re: ':
|
||||||
title = title[4:]
|
title = title[4:]
|
||||||
if title != None and title[0:6] == '[xml] ':
|
if title is not None and title[0:6] == '[xml] ':
|
||||||
title = title[6:]
|
title = title[6:]
|
||||||
newmsg = newmsg + scanXMLMsgArchive(msg, title, force)
|
newmsg = newmsg + scanXMLMsgArchive(msg, title, force)
|
||||||
|
|
||||||
|
@ -1148,7 +1148,7 @@ def analyzeArchives(t = None, force = 0):
|
||||||
skipped = 0
|
skipped = 0
|
||||||
for word in wordsDictArchive.keys():
|
for word in wordsDictArchive.keys():
|
||||||
refs = wordsDictArchive[word]
|
refs = wordsDictArchive[word]
|
||||||
if refs == None:
|
if refs is None:
|
||||||
skipped = skipped + 1
|
skipped = skipped + 1
|
||||||
continue
|
continue
|
||||||
for id in refs.keys():
|
for id in refs.keys():
|
||||||
|
@ -1168,7 +1168,7 @@ def analyzeHTMLTop():
|
||||||
skipped = 0
|
skipped = 0
|
||||||
for word in wordsDictHTML.keys():
|
for word in wordsDictHTML.keys():
|
||||||
refs = wordsDictHTML[word]
|
refs = wordsDictHTML[word]
|
||||||
if refs == None:
|
if refs is None:
|
||||||
skipped = skipped + 1
|
skipped = skipped + 1
|
||||||
continue
|
continue
|
||||||
for resource in refs.keys():
|
for resource in refs.keys():
|
||||||
|
@ -1197,7 +1197,7 @@ def analyzeAPITop():
|
||||||
skipped = 0
|
skipped = 0
|
||||||
for word in wordsDict.keys():
|
for word in wordsDict.keys():
|
||||||
refs = wordsDict[word]
|
refs = wordsDict[word]
|
||||||
if refs == None:
|
if refs is None:
|
||||||
skipped = skipped + 1
|
skipped = skipped + 1
|
||||||
continue
|
continue
|
||||||
for (module, symbol) in refs.keys():
|
for (module, symbol) in refs.keys():
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Console(object):
|
||||||
def check_console(console):
|
def check_console(console):
|
||||||
if (console.state[0] == libvirt.VIR_DOMAIN_RUNNING or
|
if (console.state[0] == libvirt.VIR_DOMAIN_RUNNING or
|
||||||
console.state[0] == libvirt.VIR_DOMAIN_PAUSED):
|
console.state[0] == libvirt.VIR_DOMAIN_PAUSED):
|
||||||
if console.stream == None:
|
if console.stream is None:
|
||||||
console.stream = console.connection.newStream(libvirt.VIR_STREAM_NONBLOCK)
|
console.stream = console.connection.newStream(libvirt.VIR_STREAM_NONBLOCK)
|
||||||
console.domain.openConsole(None, console.stream, 0)
|
console.domain.openConsole(None, console.stream, 0)
|
||||||
console.stream.eventAddCallback(libvirt.VIR_STREAM_EVENT_READABLE, stream_callback, console)
|
console.stream.eventAddCallback(libvirt.VIR_STREAM_EVENT_READABLE, stream_callback, console)
|
||||||
|
|
|
@ -35,7 +35,7 @@ name = sys.argv[1]
|
||||||
|
|
||||||
# Connect to libvirt
|
# Connect to libvirt
|
||||||
conn = libvirt.openReadOnly(None)
|
conn = libvirt.openReadOnly(None)
|
||||||
if conn == None:
|
if conn is None:
|
||||||
print 'Failed to open connection to the hypervisor'
|
print 'Failed to open connection to the hypervisor'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ dir = sys.argv[1]
|
||||||
imgs = os.listdir(dir)
|
imgs = os.listdir(dir)
|
||||||
|
|
||||||
conn = libvirt.open(None)
|
conn = libvirt.open(None)
|
||||||
if conn == None:
|
if conn is None:
|
||||||
print 'Failed to open connection to the hypervisor'
|
print 'Failed to open connection to the hypervisor'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ if len(sys.argv) != 2:
|
||||||
dir = sys.argv[1]
|
dir = sys.argv[1]
|
||||||
|
|
||||||
conn = libvirt.open(None)
|
conn = libvirt.open(None)
|
||||||
if conn == None:
|
if conn is None:
|
||||||
print 'Failed to open connection to the hypervisor'
|
print 'Failed to open connection to the hypervisor'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ if len(sys.argv) != 2:
|
||||||
(name, xmldesc) = read_domain(sys.argv[1])
|
(name, xmldesc) = read_domain(sys.argv[1])
|
||||||
|
|
||||||
conn = libvirt.open(None)
|
conn = libvirt.open(None)
|
||||||
if conn == None:
|
if conn is None:
|
||||||
print 'Failed to open connection to the hypervisor'
|
print 'Failed to open connection to the hypervisor'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ except libvirt.libvirtError:
|
||||||
print "Starting domain %s ... " % name,
|
print "Starting domain %s ... " % name,
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
dom = conn.createLinux(xmldesc, 0)
|
dom = conn.createLinux(xmldesc, 0)
|
||||||
if dom == None:
|
if dom is None:
|
||||||
print "failed"
|
print "failed"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -136,7 +136,7 @@ class docParser(xml.sax.handler.ContentHandler):
|
||||||
print "end %s" % tag
|
print "end %s" % tag
|
||||||
if tag == 'function':
|
if tag == 'function':
|
||||||
# fuctions come from source files, hence 'virerror.c'
|
# fuctions come from source files, hence 'virerror.c'
|
||||||
if self.function != None:
|
if self.function is not None:
|
||||||
if (self.function_module == "libvirt" or
|
if (self.function_module == "libvirt" or
|
||||||
self.function_module == "virevent" or
|
self.function_module == "virevent" or
|
||||||
self.function_module == "virerror"):
|
self.function_module == "virerror"):
|
||||||
|
@ -641,9 +641,9 @@ def print_function_wrapper(module, name, output, export, include):
|
||||||
(f, t, n, c) = py_types[arg[1]]
|
(f, t, n, c) = py_types[arg[1]]
|
||||||
if (f == 'z') and (name in foreign_encoding_args) and (num_bufs == 0):
|
if (f == 'z') and (name in foreign_encoding_args) and (num_bufs == 0):
|
||||||
f = 't#'
|
f = 't#'
|
||||||
if f != None:
|
if f is not None:
|
||||||
format = format + f
|
format = format + f
|
||||||
if t != None:
|
if t is not None:
|
||||||
format_args = format_args + ", &pyobj_%s" % (arg[0])
|
format_args = format_args + ", &pyobj_%s" % (arg[0])
|
||||||
c_args = c_args + " PyObject *pyobj_%s;\n" % (arg[0])
|
c_args = c_args + " PyObject *pyobj_%s;\n" % (arg[0])
|
||||||
c_convert = c_convert + \
|
c_convert = c_convert + \
|
||||||
|
@ -686,7 +686,7 @@ def print_function_wrapper(module, name, output, export, include):
|
||||||
elif py_types.has_key(ret[0]):
|
elif py_types.has_key(ret[0]):
|
||||||
(f, t, n, c) = py_types[ret[0]]
|
(f, t, n, c) = py_types[ret[0]]
|
||||||
c_return = " %s c_retval;\n" % (ret[0])
|
c_return = " %s c_retval;\n" % (ret[0])
|
||||||
if file == "python_accessor" and ret[2] != None:
|
if file == "python_accessor" and ret[2] is not None:
|
||||||
c_call = "\n c_retval = %s->%s;\n" % (args[0][0], ret[2])
|
c_call = "\n c_retval = %s->%s;\n" % (args[0][0], ret[2])
|
||||||
else:
|
else:
|
||||||
c_call = "\n c_retval = %s(%s);\n" % (name, c_call)
|
c_call = "\n c_retval = %s(%s);\n" % (name, c_call)
|
||||||
|
@ -708,7 +708,7 @@ def print_function_wrapper(module, name, output, export, include):
|
||||||
unknown_types[ret[0]] = [name]
|
unknown_types[ret[0]] = [name]
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
if cond != None and cond != "":
|
if cond is not None and cond != "":
|
||||||
include.write("#if %s\n" % cond)
|
include.write("#if %s\n" % cond)
|
||||||
export.write("#if %s\n" % cond)
|
export.write("#if %s\n" % cond)
|
||||||
output.write("#if %s\n" % cond)
|
output.write("#if %s\n" % cond)
|
||||||
|
@ -729,14 +729,14 @@ def print_function_wrapper(module, name, output, export, include):
|
||||||
|
|
||||||
if file == "python":
|
if file == "python":
|
||||||
# Those have been manually generated
|
# Those have been manually generated
|
||||||
if cond != None and cond != "":
|
if cond is not None and cond != "":
|
||||||
include.write("#endif\n")
|
include.write("#endif\n")
|
||||||
export.write("#endif\n")
|
export.write("#endif\n")
|
||||||
output.write("#endif\n")
|
output.write("#endif\n")
|
||||||
return 1
|
return 1
|
||||||
if file == "python_accessor" and ret[0] != "void" and ret[2] is None:
|
if file == "python_accessor" and ret[0] != "void" and ret[2] is None:
|
||||||
# Those have been manually generated
|
# Those have been manually generated
|
||||||
if cond != None and cond != "":
|
if cond is not None and cond != "":
|
||||||
include.write("#endif\n")
|
include.write("#endif\n")
|
||||||
export.write("#endif\n")
|
export.write("#endif\n")
|
||||||
output.write("#endif\n")
|
output.write("#endif\n")
|
||||||
|
@ -771,7 +771,7 @@ def print_function_wrapper(module, name, output, export, include):
|
||||||
output.write(" LIBVIRT_END_ALLOW_THREADS;\n")
|
output.write(" LIBVIRT_END_ALLOW_THREADS;\n")
|
||||||
output.write(ret_convert)
|
output.write(ret_convert)
|
||||||
output.write("}\n\n")
|
output.write("}\n\n")
|
||||||
if cond != None and cond != "":
|
if cond is not None and cond != "":
|
||||||
include.write("#endif /* %s */\n" % cond)
|
include.write("#endif /* %s */\n" % cond)
|
||||||
export.write("#endif /* %s */\n" % cond)
|
export.write("#endif /* %s */\n" % cond)
|
||||||
output.write("#endif /* %s */\n" % cond)
|
output.write("#endif /* %s */\n" % cond)
|
||||||
|
@ -1313,7 +1313,7 @@ def buildWrappers(module):
|
||||||
classes.write("#\n")
|
classes.write("#\n")
|
||||||
classes.write("# WARNING WARNING WARNING WARNING\n")
|
classes.write("# WARNING WARNING WARNING WARNING\n")
|
||||||
classes.write("#\n")
|
classes.write("#\n")
|
||||||
if extra != None:
|
if extra is not None:
|
||||||
classes.writelines(extra.readlines())
|
classes.writelines(extra.readlines())
|
||||||
classes.write("#\n")
|
classes.write("#\n")
|
||||||
classes.write("# WARNING WARNING WARNING WARNING\n")
|
classes.write("# WARNING WARNING WARNING WARNING\n")
|
||||||
|
@ -1321,7 +1321,7 @@ def buildWrappers(module):
|
||||||
classes.write("# Automatically written part of python bindings for libvirt\n")
|
classes.write("# Automatically written part of python bindings for libvirt\n")
|
||||||
classes.write("#\n")
|
classes.write("#\n")
|
||||||
classes.write("# WARNING WARNING WARNING WARNING\n")
|
classes.write("# WARNING WARNING WARNING WARNING\n")
|
||||||
if extra != None:
|
if extra is not None:
|
||||||
extra.close()
|
extra.close()
|
||||||
|
|
||||||
if function_classes.has_key("None"):
|
if function_classes.has_key("None"):
|
||||||
|
@ -1460,7 +1460,7 @@ def buildWrappers(module):
|
||||||
destruct=None
|
destruct=None
|
||||||
if classes_destructors.has_key(classname):
|
if classes_destructors.has_key(classname):
|
||||||
classes.write(" def __del__(self):\n")
|
classes.write(" def __del__(self):\n")
|
||||||
classes.write(" if self._o != None:\n")
|
classes.write(" if self._o is not None:\n")
|
||||||
classes.write(" libvirtmod.%s(self._o)\n" %
|
classes.write(" libvirtmod.%s(self._o)\n" %
|
||||||
classes_destructors[classname])
|
classes_destructors[classname])
|
||||||
classes.write(" self._o = None\n\n")
|
classes.write(" self._o = None\n\n")
|
||||||
|
@ -1776,7 +1776,7 @@ def qemuBuildWrappers(module):
|
||||||
fd.write("#\n")
|
fd.write("#\n")
|
||||||
fd.write("# WARNING WARNING WARNING WARNING\n")
|
fd.write("# WARNING WARNING WARNING WARNING\n")
|
||||||
fd.write("#\n")
|
fd.write("#\n")
|
||||||
if extra != None:
|
if extra is not None:
|
||||||
fd.writelines(extra.readlines())
|
fd.writelines(extra.readlines())
|
||||||
fd.write("#\n")
|
fd.write("#\n")
|
||||||
fd.write("# WARNING WARNING WARNING WARNING\n")
|
fd.write("# WARNING WARNING WARNING WARNING\n")
|
||||||
|
@ -1784,7 +1784,7 @@ def qemuBuildWrappers(module):
|
||||||
fd.write("# Automatically written part of python bindings for libvirt\n")
|
fd.write("# Automatically written part of python bindings for libvirt\n")
|
||||||
fd.write("#\n")
|
fd.write("#\n")
|
||||||
fd.write("# WARNING WARNING WARNING WARNING\n")
|
fd.write("# WARNING WARNING WARNING WARNING\n")
|
||||||
if extra != None:
|
if extra is not None:
|
||||||
extra.close()
|
extra.close()
|
||||||
|
|
||||||
fd.write("try:\n")
|
fd.write("try:\n")
|
||||||
|
@ -1888,7 +1888,7 @@ def lxcBuildWrappers(module):
|
||||||
fd.write("#\n")
|
fd.write("#\n")
|
||||||
fd.write("# WARNING WARNING WARNING WARNING\n")
|
fd.write("# WARNING WARNING WARNING WARNING\n")
|
||||||
fd.write("#\n")
|
fd.write("#\n")
|
||||||
if extra != None:
|
if extra is not None:
|
||||||
fd.writelines(extra.readlines())
|
fd.writelines(extra.readlines())
|
||||||
fd.write("#\n")
|
fd.write("#\n")
|
||||||
fd.write("# WARNING WARNING WARNING WARNING\n")
|
fd.write("# WARNING WARNING WARNING WARNING\n")
|
||||||
|
@ -1896,7 +1896,7 @@ def lxcBuildWrappers(module):
|
||||||
fd.write("# Automatically written part of python bindings for libvirt\n")
|
fd.write("# Automatically written part of python bindings for libvirt\n")
|
||||||
fd.write("#\n")
|
fd.write("#\n")
|
||||||
fd.write("# WARNING WARNING WARNING WARNING\n")
|
fd.write("# WARNING WARNING WARNING WARNING\n")
|
||||||
if extra != None:
|
if extra is not None:
|
||||||
extra.close()
|
extra.close()
|
||||||
|
|
||||||
fd.write("try:\n")
|
fd.write("try:\n")
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if self._o != None:
|
if self._o is not None:
|
||||||
libvirtmod.virConnectClose(self._o)
|
libvirtmod.virConnectClose(self._o)
|
||||||
self._o = None
|
self._o = None
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if self._o != None:
|
if self._o is not None:
|
||||||
libvirtmod.virStreamFree(self._o)
|
libvirtmod.virStreamFree(self._o)
|
||||||
self._o = None
|
self._o = None
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@
|
||||||
the request would block, integer -2 is returned.
|
the request would block, integer -2 is returned.
|
||||||
"""
|
"""
|
||||||
ret = libvirtmod.virStreamRecv(self._o, nbytes)
|
ret = libvirtmod.virStreamRecv(self._o, nbytes)
|
||||||
if ret == None: raise libvirtError ('virStreamRecv() failed')
|
if ret is None: raise libvirtError ('virStreamRecv() failed')
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def send(self, data):
|
def send(self, data):
|
||||||
|
|
Loading…
Reference in New Issue