예제 #1
0
def quote(text):
    return text.replace("'", "\\'")


print "DELETE FROM documentation_commands;"
print "DELETE FROM documentation_settings;"
print "DELETE FROM documentation_events;"
print "DELETE FROM documentation_objects;"
print "DELETE FROM documentation_objects_methods;"
print "DELETE FROM documentation_objects_properties;"

# Time
print "REPLACE INTO documentation_settings VALUES('generated', %u);" % int(
    time.time())
print "REPLACE INTO documentation_settings VALUES('version', '%s');" % (quote(
    getVersion()))

for command in commands:
    print "REPLACE INTO documentation_commands VALUES('%s', '%s', '%s', '%s');" % (
        quote(command['name']), quote(command['description']),
        quote(command['usage']), quote(command['notes']))

for event in events:
    print "REPLACE INTO documentation_events VALUES('%s', '%s', '%s', '%s', '%s', '%s');" % (
        quote(event['name']), quote(event['prototype']),
        quote(event['parameters']), quote(event['returnvalue']),
        quote(event['callcondition']), quote(event['notes']))

for object in objects:
    # Copy methods and properties from inherited object types
    for method in objectsmethods:
예제 #2
0
			functions += newfunctions

	# Get subdirectories and process them
	entries = glob(path + '/*')
	for entry in entries:
		if os.path.isdir(entry):
			examine(entry)

for path in paths:
	examine(path)

def quote(text):
	return text.replace("'", "\\'")

# Time
version = getVersion()
generated = time.strftime("%d.%m.%Y %H:%M")

def namesort(a, b):
	return cmp(a['name'], b['name'])

# Compile a command overview
overview = ''
cols = 7
rows = int(math.ceil(len(commands) / 7.0))
commands.sort(namesort)

for row in range(0, rows):
	overview += "<tr>\n"

	for col in range(0, cols):
예제 #3
0
for path in paths:
	examine(path)

def quote(text):
	return text.replace("'", "\\'")

print "DELETE FROM documentation_commands;"
print "DELETE FROM documentation_settings;"
print "DELETE FROM documentation_events;"
print "DELETE FROM documentation_objects;"
print "DELETE FROM documentation_objects_methods;"
print "DELETE FROM documentation_objects_properties;"

# Time
print "REPLACE INTO documentation_settings VALUES('generated', %u);" % int(time.time())
print "REPLACE INTO documentation_settings VALUES('version', '%s');" % (quote(getVersion()))

for command in commands:
	print "REPLACE INTO documentation_commands VALUES('%s', '%s', '%s', '%s');" % (quote(command['name']), quote(command['description']), quote(command['usage']), quote(command['notes']))

for event in events:
	print "REPLACE INTO documentation_events VALUES('%s', '%s', '%s', '%s', '%s', '%s');" % (quote(event['name']), quote(event['prototype']), quote(event['parameters']), quote(event['returnvalue']), quote(event['callcondition']), quote(event['notes']))

for object in objects:
	# Copy methods and properties from inherited object types
	for method in objectsmethods:

		if method['object'] in object['inherit']:
			method = dict(method)
			method['object'] = object['object']
			objectsmethods.append(method)