Spaces:
Runtime error
Runtime error
Now dynamic credits
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ from data import usuarios
|
|
5 |
import encrypter
|
6 |
import time
|
7 |
import nycklar.nodes
|
|
|
8 |
|
9 |
#Funciones
|
10 |
def authenticate(username, password):
|
@@ -71,9 +72,7 @@ def perform(input1, input2):
|
|
71 |
#Y finalmente debita los tokens.
|
72 |
gr.State.tokens = sulkuPypi.debitTokens(gr.State.capsule, "picswap")
|
73 |
print(f"Y ahora tienes: {gr.State.tokens} tokens.")
|
74 |
-
html_credits =
|
75 |
-
<div style="text-align: right;">💶<b>Credits Available:</b> 20</div>
|
76 |
-
"""
|
77 |
info_window = "Image ready!"
|
78 |
|
79 |
else:
|
|
|
5 |
import encrypter
|
6 |
import time
|
7 |
import nycklar.nodes
|
8 |
+
import tools
|
9 |
|
10 |
#Funciones
|
11 |
def authenticate(username, password):
|
|
|
72 |
#Y finalmente debita los tokens.
|
73 |
gr.State.tokens = sulkuPypi.debitTokens(gr.State.capsule, "picswap")
|
74 |
print(f"Y ahora tienes: {gr.State.tokens} tokens.")
|
75 |
+
html_credits = tools.actualizar_creditos(gr.State.tokens)
|
|
|
|
|
76 |
info_window = "Image ready!"
|
77 |
|
78 |
else:
|
data.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
usuarios = [
|
2 |
("usuario1", "contraseña1"),
|
3 |
("usuario2", "contraseña2"),
|
4 |
-
("briggsboardman", "cfgmrv539048")
|
|
|
5 |
]
|
|
|
1 |
usuarios = [
|
2 |
("usuario1", "contraseña1"),
|
3 |
("usuario2", "contraseña2"),
|
4 |
+
("briggsboardman", "cfgmrv539048"),
|
5 |
+
("moibe", "12345")
|
6 |
]
|
tools.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
def actualizar_creditos(nuevos_creditos):
|
3 |
+
|
4 |
+
html_credits = f"""
|
5 |
+
<div style="text-align: right;">💶<b>Credits Available:</b> {nuevos_creditos}</div>
|
6 |
+
"""
|
7 |
+
|
8 |
+
print(html_credits)
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
# Para actualizar los créditos a 500:
|
13 |
+
actualizar_creditos(500)
|