Spaces:
Running
Running
File size: 849 Bytes
ea6d989 2303553 ea6d989 120ba68 3b87fd3 ea6d989 120ba68 ea6d989 120ba68 151409b 6b2b610 120ba68 6b2b610 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
import time
import avaimet
import gradio as gr
def getAccess(userfile):
sshListo, sftpListo = avaimet.conecta()
#Obtiene la caja donde está guardados los tokens.
caja = avaimet.obtenCaja(userfile)
tokens = avaimet.obtenTokens(sftpListo, caja)
resultado_final = avaimet.aplicaReglas(sftpListo, caja, tokens)
avaimet.cierraConexion(sshListo, sftpListo)
return resultado_final
def print():
print("Hola mundo")
return "Hola Mundo"
with gr.Blocks() as demo:
with gr.Row():
with gr.Column():
text_input = gr.Textbox()
enviar_btn = gr.Button(value="Submit")
with gr.Column():
text_output = gr.Textbox()
enviar_btn.click(fn=getAccess, inputs="text", outputs="text", api_name="entrar")
demo.launch() |