# line[i] == '>' or line[i] == '<' or line[i] == '=' or \
# line[i] == '/' or line[i] == '%' or line[i] == '&' or \
# line[i] == '!' or line[i] == '|' or line[i] == '.':
- if line[i] == '.' and i + 2 < l and \
+ if line[i] == '.' and i + 2 < l and \
line[i+1] == '.' and line[i+2] == '.':
self.tokens.append(('name', '...'))
i = i + 3
while token[0] != "sep" or (token[1] != ',' and
token[1] != '}'):
# We might be dealing with '1U << 12' here
- value = value + re.sub("^(\d+)U$","\\1", token[1])
+ value = value + re.sub("^(\d+)U$", "\\1", token[1])
token = self.token()
else:
try:
while token is not None and token[0] == "op" and token[1] == '*':
self.type = self.type + token[1]
token = self.token()
- if token is None or token[0] != "name" :
+ if token is None or token[0] != "name":
self.error("parsing function type, name expected", token)
return token
self.type = self.type + token[1]
# this dict contains the functions that are allowed to use [unsigned]
# long for legacy reasons in their signature and return type. this list is
# fixed. new procedures and public APIs have to use [unsigned] long long
- long_legacy_functions = \
- { "virGetVersion" : (False, ("libVer", "typeVer")),
- "virConnectGetLibVersion" : (False, ("libVer")),
- "virConnectGetVersion" : (False, ("hvVer")),
- "virDomainGetMaxMemory" : (True, ()),
- "virDomainMigrate" : (False, ("flags", "bandwidth")),
- "virDomainMigrate2" : (False, ("flags", "bandwidth")),
- "virDomainMigrateBegin3" : (False, ("flags", "bandwidth")),
- "virDomainMigrateConfirm3" : (False, ("flags", "bandwidth")),
- "virDomainMigrateDirect" : (False, ("flags", "bandwidth")),
- "virDomainMigrateFinish" : (False, ("flags")),
- "virDomainMigrateFinish2" : (False, ("flags")),
- "virDomainMigrateFinish3" : (False, ("flags")),
- "virDomainMigratePeer2Peer" : (False, ("flags", "bandwidth")),
- "virDomainMigratePerform" : (False, ("flags", "bandwidth")),
- "virDomainMigratePerform3" : (False, ("flags", "bandwidth")),
- "virDomainMigratePrepare" : (False, ("flags", "bandwidth")),
- "virDomainMigratePrepare2" : (False, ("flags", "bandwidth")),
- "virDomainMigratePrepare3" : (False, ("flags", "bandwidth")),
- "virDomainMigratePrepareTunnel" : (False, ("flags", "bandwidth")),
- "virDomainMigratePrepareTunnel3" : (False, ("flags", "bandwidth")),
- "virDomainMigrateToURI" : (False, ("flags", "bandwidth")),
- "virDomainMigrateToURI2" : (False, ("flags", "bandwidth")),
- "virDomainMigrateVersion1" : (False, ("flags", "bandwidth")),
- "virDomainMigrateVersion2" : (False, ("flags", "bandwidth")),
- "virDomainMigrateVersion3" : (False, ("flags", "bandwidth")),
- "virDomainMigrateSetMaxSpeed" : (False, ("bandwidth")),
- "virDomainSetMaxMemory" : (False, ("memory")),
- "virDomainSetMemory" : (False, ("memory")),
- "virDomainSetMemoryFlags" : (False, ("memory")),
- "virDomainBlockCommit" : (False, ("bandwidth")),
- "virDomainBlockJobSetSpeed" : (False, ("bandwidth")),
- "virDomainBlockPull" : (False, ("bandwidth")),
- "virDomainBlockRebase" : (False, ("bandwidth")),
- "virDomainMigrateGetMaxSpeed" : (False, ("bandwidth")) }
+ long_legacy_functions = {
+ "virGetVersion": (False, ("libVer", "typeVer")),
+ "virConnectGetLibVersion": (False, ("libVer")),
+ "virConnectGetVersion": (False, ("hvVer")),
+ "virDomainGetMaxMemory": (True, ()),
+ "virDomainMigrate": (False, ("flags", "bandwidth")),
+ "virDomainMigrate2": (False, ("flags", "bandwidth")),
+ "virDomainMigrateBegin3": (False, ("flags", "bandwidth")),
+ "virDomainMigrateConfirm3": (False, ("flags", "bandwidth")),
+ "virDomainMigrateDirect": (False, ("flags", "bandwidth")),
+ "virDomainMigrateFinish": (False, ("flags")),
+ "virDomainMigrateFinish2": (False, ("flags")),
+ "virDomainMigrateFinish3": (False, ("flags")),
+ "virDomainMigratePeer2Peer": (False, ("flags", "bandwidth")),
+ "virDomainMigratePerform": (False, ("flags", "bandwidth")),
+ "virDomainMigratePerform3": (False, ("flags", "bandwidth")),
+ "virDomainMigratePrepare": (False, ("flags", "bandwidth")),
+ "virDomainMigratePrepare2": (False, ("flags", "bandwidth")),
+ "virDomainMigratePrepare3": (False, ("flags", "bandwidth")),
+ "virDomainMigratePrepareTunnel": (False, ("flags", "bandwidth")),
+ "virDomainMigratePrepareTunnel3": (False, ("flags", "bandwidth")),
+ "virDomainMigrateToURI": (False, ("flags", "bandwidth")),
+ "virDomainMigrateToURI2": (False, ("flags", "bandwidth")),
+ "virDomainMigrateVersion1": (False, ("flags", "bandwidth")),
+ "virDomainMigrateVersion2": (False, ("flags", "bandwidth")),
+ "virDomainMigrateVersion3": (False, ("flags", "bandwidth")),
+ "virDomainMigrateSetMaxSpeed": (False, ("bandwidth")),
+ "virDomainSetMaxMemory": (False, ("memory")),
+ "virDomainSetMemory": (False, ("memory")),
+ "virDomainSetMemoryFlags": (False, ("memory")),
+ "virDomainBlockCommit": (False, ("bandwidth")),
+ "virDomainBlockJobSetSpeed": (False, ("bandwidth")),
+ "virDomainBlockPull": (False, ("bandwidth")),
+ "virDomainBlockRebase": (False, ("bandwidth")),
+ "virDomainMigrateGetMaxSpeed": (False, ("bandwidth"))
+ }
def checkLongLegacyFunction(self, name, return_type, signature):
if "long" in return_type and "long long" not in return_type:
# this dict contains the structs that are allowed to use [unsigned]
# long for legacy reasons. this list is fixed. new structs have to use
# [unsigned] long long
- long_legacy_struct_fields = \
- { "_virDomainInfo" : ("maxMem", "memory"),
- "_virNodeInfo" : ("memory"),
- "_virDomainBlockJobInfo" : ("bandwidth") }
+ long_legacy_struct_fields = {
+ "_virDomainInfo": ("maxMem", "memory"),
+ "_virNodeInfo": ("memory"),
+ "_virDomainBlockJobInfo": ("bandwidth")
+ }
def checkLongLegacyStruct(self, name, fields):
for field in fields:
elif token[1] == 'static':
static = 1
token = self.token()
- if token is None or token[0] != 'name':
+ if token is None or token[0] != 'name':
return token
if token[1] == 'typedef':
output.write(" </macro>\n")
def serialize_union(self, output, field, desc):
- output.write(" <field name='%s' type='union' info='%s'>\n" % (field[1] , desc))
+ output.write(" <field name='%s' type='union' info='%s'>\n" % (field[1], desc))
output.write(" <union>\n")
for f in field[3]:
desc = f[2]
desc = ''
else:
desc = escape(desc)
- output.write(" <field name='%s' type='%s' info='%s'/>\n" % (f[1] , f[0], desc))
+ output.write(" <field name='%s' type='%s' info='%s'/>\n" % (f[1], f[0], desc))
output.write(" </union>\n")
output.write(" </field>\n")
if field[0] == "union":
self.serialize_union(output, field, desc)
else:
- output.write(" <field name='%s' type='%s' info='%s'/>\n" % (field[1] , field[0], desc))
+ output.write(" <field name='%s' type='%s' info='%s'/>\n" % (field[1], field[0], desc))
except:
self.warning("Failed to serialize struct %s" % (name))
output.write(" </struct>\n")
else:
output.write("/>\n")
- else :
+ else:
output.write(" <typedef name='%s' file='%s' type='%s'" % (
name, self.modulename_file(id.header), id.info))
try:
typ = sorted(funcs.keys())
for type in typ:
if type == '' or type == 'void' or type == "int" or \
- type == "char *" or type == "const char *" :
+ type == "char *" or type == "const char *":
continue
output.write(" <type name='%s'>\n" % (type))
ids = funcs[type]
typ = sorted(funcs.keys())
for type in typ:
if type == '' or type == 'void' or type == "int" or \
- type == "char *" or type == "const char *" :
+ type == "char *" or type == "const char *":
continue
output.write(" <type name='%s'>\n" % (type))
ids = sorted(funcs[type])
builddir = os.path.abspath((os.environ["builddir"]))
if srcdir == builddir:
builddir = None
- if glob.glob(srcdir + "/../src/libvirt.c") != [] :
+ if glob.glob(srcdir + "/../src/libvirt.c") != []:
if not quiet:
print("Rebuilding API description for %s" % name)
dirs = [srcdir + "/../src",
not os.path.exists(srcdir + "/../include/libvirt/libvirt-common.h")):
dirs.append(builddir + "/../include/libvirt")
builder = docBuilder(name, srcdir, dirs, [])
- elif glob.glob("src/libvirt.c") != [] :
+ elif glob.glob("src/libvirt.c") != []:
if not quiet:
print("Rebuilding API description for %s" % name)
builder = docBuilder(name, srcdir,
# to create them
#
TABLES={
- "symbols" : """CREATE TABLE symbols (
+ "symbols": """CREATE TABLE symbols (
name varchar(255) BINARY NOT NULL,
module varchar(255) BINARY NOT NULL,
type varchar(25) NOT NULL,
descr varchar(255),
UNIQUE KEY name (name),
KEY module (module))""",
- "words" : """CREATE TABLE words (
+ "words": """CREATE TABLE words (
name varchar(50) BINARY NOT NULL,
symbol varchar(255) BINARY NOT NULL,
relevance int,
KEY name (name),
KEY symbol (symbol),
UNIQUE KEY ID (name, symbol))""",
- "wordsHTML" : """CREATE TABLE wordsHTML (
+ "wordsHTML": """CREATE TABLE wordsHTML (
name varchar(50) BINARY NOT NULL,
resource varchar(255) BINARY NOT NULL,
section varchar(255),
KEY name (name),
KEY resource (resource),
UNIQUE KEY ref (name, resource))""",
- "wordsArchive" : """CREATE TABLE wordsArchive (
+ "wordsArchive": """CREATE TABLE wordsArchive (
name varchar(50) BINARY NOT NULL,
ID int(11) NOT NULL,
relevance int,
KEY name (name),
UNIQUE KEY ref (name, ID))""",
- "pages" : """CREATE TABLE pages (
+ "pages": """CREATE TABLE pages (
resource varchar(255) BINARY NOT NULL,
title varchar(255) BINARY NOT NULL,
UNIQUE KEY name (resource))""",
- "archives" : """CREATE TABLE archives (
+ "archives": """CREATE TABLE archives (
ID int(11) NOT NULL auto_increment,
resource varchar(255) BINARY NOT NULL,
title varchar(255) BINARY NOT NULL,
UNIQUE KEY id (ID,resource(255)),
INDEX (ID),
INDEX (resource))""",
- "Queries" : """CREATE TABLE Queries (
+ "Queries": """CREATE TABLE Queries (
ID int(11) NOT NULL auto_increment,
Value varchar(50) NOT NULL,
Count int(11) NOT NULL,
UNIQUE KEY id (ID,Value(35)),
INDEX (ID))""",
- "AllQueries" : """CREATE TABLE AllQueries (
+ "AllQueries": """CREATE TABLE AllQueries (
ID int(11) NOT NULL auto_increment,
Value varchar(50) NOT NULL,
Count int(11) NOT NULL,
if verbose:
print "Table %s contains %d records" % (table, row[0])
except:
- print "Troubles with table %s : repairing" % (table)
+ print "Troubles with table %s: repairing" % (table)
ret = c.execute("repair table %s" % table)
print "repairing returned %d" % (ret)
ret = c.execute("SELECT count(*) from %s" % table)
doc = libxml2.htmlParseFile(html, None)
try:
res = analyzeHTML(doc, html)
- print "Parsed %s : %d paragraphs" % (html, res)
+ print "Parsed %s: %d paragraphs" % (html, res)
ret = ret + 1
except:
print "could not parse %s" % (html)
elif args[i] == '--archive-year':
i = i + 1
year = args[i]
- months = ["January" , "February", "March", "April", "May",
+ months = ["January", "February", "March", "April", "May",
"June", "July", "August", "September", "October",
"November", "December"]
for month in months:
"MethodFault",
"ManagedObjectReference"]
-additional_enum_features = { "ManagedEntityStatus" : Enum.FEATURE__ANY_TYPE,
- "TaskInfoState" : Enum.FEATURE__ANY_TYPE,
- "VirtualMachinePowerState" : Enum.FEATURE__ANY_TYPE }
-
-additional_object_features = { "AutoStartDefaults" : Object.FEATURE__ANY_TYPE,
- "AutoStartPowerInfo" : Object.FEATURE__ANY_TYPE,
- "DatastoreHostMount" : Object.FEATURE__DEEP_COPY |
- Object.FEATURE__LIST |
- Object.FEATURE__ANY_TYPE,
- "DatastoreInfo" : Object.FEATURE__ANY_TYPE |
- Object.FEATURE__DYNAMIC_CAST,
- "HostConfigManager" : Object.FEATURE__ANY_TYPE,
- "HostCpuIdInfo" : Object.FEATURE__LIST |
- Object.FEATURE__ANY_TYPE,
- "HostDatastoreBrowserSearchResults" : Object.FEATURE__LIST |
- Object.FEATURE__ANY_TYPE,
- "HostHostBusAdapter" : Object.FEATURE__LIST |
- Object.FEATURE__ANY_TYPE,
- "HostInternetScsiHba" : Object.FEATURE__DYNAMIC_CAST |
- Object.FEATURE__DEEP_COPY,
- "HostInternetScsiTargetTransport" : Object.FEATURE__DYNAMIC_CAST,
- "HostScsiDisk" : Object.FEATURE__LIST |
- Object.FEATURE__ANY_TYPE |
- Object.FEATURE__DYNAMIC_CAST,
- "HostScsiTopologyInterface" : Object.FEATURE__LIST |
- Object.FEATURE__ANY_TYPE,
- "HostScsiTopologyLun" : Object.FEATURE__ANY_TYPE |
- Object.FEATURE__LIST |
- Object.FEATURE__DEEP_COPY,
- "HostScsiTopologyTarget" : Object.FEATURE__ANY_TYPE |
- Object.FEATURE__LIST,
- "HostPortGroup" : Object.FEATURE__LIST |
- Object.FEATURE__ANY_TYPE,
- "HostVirtualSwitch" : Object.FEATURE__DEEP_COPY |
- Object.FEATURE__LIST |
- Object.FEATURE__ANY_TYPE,
- "ManagedObjectReference" : Object.FEATURE__ANY_TYPE,
- "ObjectContent" : Object.FEATURE__DEEP_COPY,
- "PhysicalNic" : Object.FEATURE__DEEP_COPY |
- Object.FEATURE__LIST |
- Object.FEATURE__ANY_TYPE,
- "ResourcePoolResourceUsage" : Object.FEATURE__ANY_TYPE,
- "ScsiLun" : Object.FEATURE__LIST |
- Object.FEATURE__ANY_TYPE |
- Object.FEATURE__DEEP_COPY,
- "ScsiLunDurableName" : Object.FEATURE__LIST,
- "ServiceContent" : Object.FEATURE__DESERIALIZE,
- "SharesInfo" : Object.FEATURE__ANY_TYPE,
- "TaskInfo" : Object.FEATURE__LIST |
- Object.FEATURE__ANY_TYPE,
- "UserSession" : Object.FEATURE__ANY_TYPE,
- "VirtualMachineQuestionInfo" : Object.FEATURE__ANY_TYPE,
- "VirtualMachineSnapshotTree" : Object.FEATURE__DEEP_COPY |
- Object.FEATURE__ANY_TYPE,
- "VmEventArgument" : Object.FEATURE__DESERIALIZE }
+additional_enum_features = {
+ "ManagedEntityStatus": Enum.FEATURE__ANY_TYPE,
+ "TaskInfoState": Enum.FEATURE__ANY_TYPE,
+ "VirtualMachinePowerState": Enum.FEATURE__ANY_TYPE
+}
+
+additional_object_features = {
+ "AutoStartDefaults": Object.FEATURE__ANY_TYPE,
+ "AutoStartPowerInfo": Object.FEATURE__ANY_TYPE,
+ "DatastoreHostMount": (Object.FEATURE__DEEP_COPY | Object.FEATURE__LIST |
+ Object.FEATURE__ANY_TYPE),
+ "DatastoreInfo": Object.FEATURE__ANY_TYPE | Object.FEATURE__DYNAMIC_CAST,
+ "HostConfigManager": Object.FEATURE__ANY_TYPE,
+ "HostCpuIdInfo": Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE,
+ "HostDatastoreBrowserSearchResults": (Object.FEATURE__LIST |
+ Object.FEATURE__ANY_TYPE),
+ "HostHostBusAdapter": Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE,
+ "HostInternetScsiHba": (Object.FEATURE__DYNAMIC_CAST |
+ Object.FEATURE__DEEP_COPY),
+ "HostInternetScsiTargetTransport": Object.FEATURE__DYNAMIC_CAST,
+ "HostScsiDisk": (Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE |
+ Object.FEATURE__DYNAMIC_CAST),
+ "HostScsiTopologyInterface": (Object.FEATURE__LIST |
+ Object.FEATURE__ANY_TYPE),
+ "HostScsiTopologyLun": (Object.FEATURE__ANY_TYPE | Object.FEATURE__LIST |
+ Object.FEATURE__DEEP_COPY),
+ "HostScsiTopologyTarget": Object.FEATURE__ANY_TYPE | Object.FEATURE__LIST,
+ "HostPortGroup": Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE,
+ "HostVirtualSwitch": (Object.FEATURE__DEEP_COPY | Object.FEATURE__LIST |
+ Object.FEATURE__ANY_TYPE),
+ "ManagedObjectReference": Object.FEATURE__ANY_TYPE,
+ "ObjectContent": Object.FEATURE__DEEP_COPY,
+ "PhysicalNic": (Object.FEATURE__DEEP_COPY | Object.FEATURE__LIST |
+ Object.FEATURE__ANY_TYPE),
+ "ResourcePoolResourceUsage": Object.FEATURE__ANY_TYPE,
+ "ScsiLun": (Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE |
+ Object.FEATURE__DEEP_COPY),
+ "ScsiLunDurableName": Object.FEATURE__LIST,
+ "ServiceContent": Object.FEATURE__DESERIALIZE,
+ "SharesInfo": Object.FEATURE__ANY_TYPE,
+ "TaskInfo": Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE,
+ "UserSession": Object.FEATURE__ANY_TYPE,
+ "VirtualMachineQuestionInfo": Object.FEATURE__ANY_TYPE,
+ "VirtualMachineSnapshotTree": (Object.FEATURE__DEEP_COPY |
+ Object.FEATURE__ANY_TYPE),
+ "VmEventArgument": Object.FEATURE__DESERIALIZE
+}
removed_object_features = {}