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 = docs_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]
def export_groups(db,advanced): groups = docs_group.list_all(db,'core',advanced) for group in groups: print str(group.id) + " " + group.name group_dir = docs_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)
def export_groups(db, advanced): groups = docs_group.list_all(db, 'core', advanced) for group in groups: print str(group.id) + " " + group.name group_dir = docs_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)
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 = docs_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]
#!/usr/bin/python import os import sys import docs_group import docs_files import docs_function import docs_members import MySQLdb docs_root = "/home/arturo/Documentos/new_of_site/_docs" index = open(docs_root + "/index.markdown",'w') db = MySQLdb.connect(host='localhost',user='******',passwd='asdqwe34',db='of_site09') adv_groups = docs_group.list_all(db,'core',True) def export_vars(db,clazz_file,clazz): variables = docs_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' )
import os import sys import docs_group import docs_files import docs_function import docs_members import MySQLdb docs_root = "/home/arturo/Documentos/new_of_site/_docs" index = open(docs_root + "/index.markdown", 'w') db = MySQLdb.connect(host='localhost', user='******', passwd='asdqwe34', db='of_site09') adv_groups = docs_group.list_all(db, 'core', True) def export_vars(db, clazz_file, clazz): variables = docs_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')