-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
83 lines (64 loc) · 2.43 KB
/
main.py
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import kivy
kivy.require('1.9.0')
#librerias de kivy aplicacion
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.textinput import TextInput
from kivy.uix.floatlayout import FloatLayout
from kivy.vector import Vector
from kivy.uix.widget import Widget
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.properties import ObjectProperty, StringProperty
from kivy.clock import Clock
#posibles librerias para ver si funciona
import storj
import json
class MenuPrincipal(Screen):
pass
class MenuRegistro(Screen):
pass
def my_callback(self,dt):
self.manager.current = 'menu_ingresar'
def registro(self):
self.correo = self.ids['correo']
self.email = self.correo.text
self.pass1 = self.ids['contra']
self.password = self.pass1.text
self.repass1 = self.ids['recontra']
self.password_repeat = self.repass1.text
self.mensaje = self.ids['mensaje_registro']
self.bridge_api_url= 'https://api.storj.io/'
success = False
if self.email != "" and self.password != "" and self.password_repeat != "":
if self.password == self.password_repeat:
try:
self.storj_client = storj.Client(None, "",self.bridge_api_url).user_create(str(self.email),str(self.password))
except storj.exception.StorjBridgeApiError as xavi:
j = json.loads(str(xavi))
if j[0]["error"] == "Email is already registered":
self.mensaje.text = "Se a creado con exito revisa tu correo para confirmar tu cuenta"
success = True
else:
self.mensaje.text= str(xavi)
else:
self.mensaje.text ="Las contrasenas son diferentes reviselas Porfavor"
else:
self.mensaje.text ="Porfavor rellene todos los campos"
if success == True:
event = Clock.schedule_once(self.my_callback,7)
class MenuIngresar(Screen):
pass
class Menufinal(Screen):
pass
class Manager(ScreenManager):
menuprincipal = ObjectProperty(None)
menuregistro = ObjectProperty(None)
menuingresar = ObjectProperty(None)
menufinal = ObjectProperty(None)
class StorjApp(App):
title = "Storj"
def build(self):
return Manager()
if __name__ in "__main__":
StorjApp().run()