Esempio n. 1
0
def výchozí_router(request):
    '''
    '''
    cesta = request.cesta
    cesta.insert(0, 'zora')
    funkce = cesta.pop()
    
    balíček = '.'.join(cesta)
    
    try:
        modul = __import__(balíček, globals(), locals(), [funkce], 0)
        return response.volej(modul,  **request.parametry)
    except TypeError as e:
        error('Selhalo volání modulu {} a funkce {}. CHYBA: {}'.format(balíček,  funkce,  e))
        return response.html400()
    except ImportError as e:
        error('V modulu {} nije funkce {}. CHYBA: {}'.format(balíček,  funkce,  e))
        return response.html404()
Esempio n. 2
0
def výchozí_router(request):
    '''
    '''
    cesta = request.cesta
    cesta.insert(0, 'zora')
    funkce = cesta.pop()

    balíček = '.'.join(cesta)

    try:
        modul = __import__(balíček, globals(), locals(), [funkce], 0)
        return response.volej(modul, **request.parametry)
    except TypeError as e:
        error('Selhalo volání modulu {} a funkce {}. CHYBA: {}'.format(
            balíček, funkce, e))
        return response.html400()
    except ImportError as e:
        error('V modulu {} nije funkce {}. CHYBA: {}'.format(
            balíček, funkce, e))
        return response.html404()
Esempio n. 3
0
def html404(request):
    return response.html404()
Esempio n. 4
0
def html404(request):
    return response.html404()