Beispiel #1
0
def index():
    try:
        templates_path = str(
            os.path.join(os.path.dirname(__file__), 'templates'))

        file = open(templates_path + '/index.html')
        db = MySQLdb.connect(host='localhost',
                             user='******',
                             passwd='asdqwe34',
                             db='of_site09')

        template = Template(renderIndex, str(file.read()))
        groups = documentation_group.list_all(db, "core", 0)
        html = str(template.render(groups))

    except Exception as inst:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        error = str(inst)  # __str__ allows args to printed directly
        error += "<br/>"
        error += str(
            traceback.format_exception(exc_type, exc_value, exc_traceback))
        error.replace('\n', "<br/>")

        return "Unexpected error:<br/>", error
    return [html]
Beispiel #2
0
def export_groups(db, advanced):
    groups = documentation_group.list_all(db, 'core', advanced)
    for group in groups:
        print str(group.id) + " " + group.name
        group_dir = documentation_root + "/" + group.name.replace(' ', '_')
        #index.write("//----------------------\n\n")
        index.write("##" + group.name + "##\n\n")
        try:
            os.mkdir(group_dir)
        except:
            pass
        export_classes(db, group_dir, group)
Beispiel #3
0
def export_groups(db,advanced):
    groups = documentation_group.list_all(db,'core',advanced)
    for group in groups:
        print str(group.id) + " " + group.name
        group_dir = documentation_root + "/" + group.name.replace(' ','_')
        #index.write("//----------------------\n\n")
        index.write("##" + group.name + "##\n\n")
        try:
            os.mkdir(group_dir)
        except:
            pass
        export_classes(db,group_dir,group)
Beispiel #4
0
def index():
    try:
        templates_path = str(os.path.join(os.path.dirname(__file__), 'templates'))

        file = open(templates_path + '/index.html')
        db=MySQLdb.connect(host='localhost',user='******',passwd='asdqwe34',db='of_site09')

        template = Template(renderIndex, str(file.read()))
        groups = documentation_group.list_all(db,"core", 0)
        html = str(template.render(groups))

    except Exception as inst:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        error = str(inst)           # __str__ allows args to printed directly
        error += "<br/>"
        error += str(traceback.format_exception(exc_type, exc_value,
                                          exc_traceback))
        error.replace('\n',"<br/>")

        return "Unexpected error:<br/>", error
    return [html]
Beispiel #5
0
import os
import sys
import documentation_group
import documentation_files
import documentation_function
import documentation_members
import MySQLdb

documentation_root = "/home/arturo/Documentos/new_of_site/_documentation"

index = open(documentation_root + "/index.markdown", 'w')
db = MySQLdb.connect(host='localhost',
                     user='******',
                     passwd='asdqwe34',
                     db='of_site09')
adv_groups = documentation_group.list_all(db, 'core', True)


def export_vars(db, clazz_file, clazz):
    variables = documentation_members.list_all_vars(db, clazz.id)
    for var in variables:
        #if var.visible and not var.advanced
        index.write(var.name + '\n\n')
        #clazz_file.write("//----------------------\n\n")
        clazz_file.write("###" + var.type + " " + var.name + "\n\n")
        clazz_file.write('_name: ' + var.name + '_\n\n')
        clazz_file.write('_type: ' + var.type + '_\n\n')
        clazz_file.write('_access: ' + var.access + '_\n\n')
        clazz_file.write('_version_started: ' + var.version_started + '_\n\n')
        clazz_file.write('_version_deprecated: ' + var.version_deprecated +
                         '_\n\n')
Beispiel #6
0
#!/usr/bin/python

import os
import sys
import documentation_group
import documentation_files
import documentation_function
import documentation_members
import MySQLdb

documentation_root = "/home/arturo/Documentos/new_of_site/_documentation"

index = open(documentation_root + "/index.markdown",'w')
db = MySQLdb.connect(host='localhost',user='******',passwd='asdqwe34',db='of_site09')
adv_groups = documentation_group.list_all(db,'core',True)


def export_vars(db,clazz_file,clazz):
    variables = documentation_members.list_all_vars(db,clazz.id)
    for var in variables:
        #if var.visible and not var.advanced
        index.write(var.name+'\n\n')
        #clazz_file.write("//----------------------\n\n")
        clazz_file.write( "###" + var.type + " " + var.name + "\n\n")
        clazz_file.write( '_name: ' + var.name + '_\n\n')
        clazz_file.write( '_type: ' + var.type + '_\n\n')
        clazz_file.write( '_access: ' + var.access + '_\n\n')
        clazz_file.write( '_version_started: ' + var.version_started + '_\n\n')
        clazz_file.write( '_version_deprecated: ' + var.version_deprecated + '_\n\n')
        clazz_file.write( '_constant: ' + var.constant + '_\n\n')
        clazz_file.write( '_summary: _\n\n' )