-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
59 lines (54 loc) · 1.8 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
#!/usr/bin/python
# -*- coding: utf-8 -*-
from kivy.app import App
from kivy.properties import ObjectProperty
from kivy.uix.screenmanager import Screen
from precios import Precio
from Conexion import getLugares
from kivy.uix.actionbar import ActionGroup
from kivy.uix.actionbar import ActionButton
class AddBoton(ActionGroup):
def __init__(self, **kwargs):
super(AddBoton,self).__init__(**kwargs)
self.id= "tx"
self.markup = True
self.text = '[b][color=#E65F00]---ttyy---[/color][/b]'
self.crear()
def crear(self):
for nom in getLugares():
bt = ActionButton(text=nom)
bt.bind(on_press=self.evt_origen)
self.add_widget(bt)
def evt_origen(self, obj):
obj.text = obj.text
print(self.ids)
org = ""+obj.text
print(org)
Ventana.origen = org
class Ventana(Screen):
precio = ObjectProperty
origen=""
destino=""
def Origen(self, origen):
self.origen = origen
print (origen)
def Destino(self, destino):
self.destino = destino
print (destino)
def CalcularPrecio(self):
print(self.origen)
if self.origen != "" and self.destino != "":
costo = ""+Precio(self.origen,self.destino)
if costo == "null":
self.precio.text ="Costo Aun no Disponible... porque vas de S a N o N a S. Proximamente."
else:
self.precio.text = "El Costo del Viaje sera de $ "+costo
else:
self.precio.text = "Aún no a Seleccionado las Ruta..."
class AplicacionApp(App):
def build(self):
return Ventana()
def on_pause(self):
return True
if __name__ == '__main__':
AplicacionApp().run()