コード例 #1
0
ファイル: app.py プロジェクト: cesargp45/tytus
def extractTable(database, table):
    mode = None
    for i in range(7):
        mode = obtenerBase(database, i)
        if mode == []:
            continue
        else:
            if mode == 0:
                mode = "avl"
            elif mode == 1:
                mode = "b"
            elif mode == 2:
                mode = "bplus"
            elif mode == 3:
                mode = "dict"
            elif mode == 4:
                mode = "isam"
            elif mode == 5:
                mode = "json"
            elif mode == 6:
                mode = "hash"
            break
    if mode == None:
        return 2
    if mode == "avl":
        # Grupo 16
        val = avl_mode.extractTable(database, table)
    elif mode == "b":
        # Grupo 17
        val = b_mode.extractTable(database, table)
    elif mode == "bplus":
        # Grupo 18
        val = bplus_mode.extractTable(database, table)
    elif mode == "dict":
        # Auxiliar
        val = dict_mode.extractTable(database, table)
    elif mode == "isam":
        # Grupo 14
        val = isam_mode.extractTable(database, table)
    elif mode == "json":
        # Ingeniero
        val = json_mode.extractTable(database, table)
    elif mode == "hash":
        # Grupo 15
        val = hash_mode.extractTable(database, table)
    else:
        val = 3
    return val
コード例 #2
0
ファイル: app.py プロジェクト: cesargp45/tytus
def obtenerContenidoTabla(database, table, estructura):
    val = []
    if estructura == 0:
        val = avl_mode.extractTable(database, table)
    elif estructura == 1:
        val = b_mode.extractTable(database, table)
    elif estructura == 2:
        val = bplus_mode.extractTable(database, table)
    elif estructura == 3:
        val = dict_mode.extractTable(database, table)
    elif estructura == 4:
        val = isam_mode.extractTable(database, table.lower())
    elif estructura == 5:
        val = json_mode.extractTable(database, table)
    elif estructura == 6:
        val = hash_mode.extractTable(database, table)
    if val == []:
        return ""
    contenido = ""
    for i in range(len(val)):
        contenido += str(val[i])
    return contenido