Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/convert.py
diff options
context:
space:
mode:
authorCristhofer Travieso <cristhofert97@gmail.com>2012-07-03 21:31:53 (GMT)
committer Cristhofer Travieso <cristhofert97@gmail.com>2012-07-03 21:31:53 (GMT)
commit7276d3b9e45b8032cfad03a874ec3d4276401caa (patch)
tree4b9e58cf44054a92b8c84e7cb215754e68d6a9ed /convert.py
parent2f9bb852d14a1e0e16a1ebe31160931cf1ee2836 (diff)
Enpese a programar el creado de las opciones de los combos
Diffstat (limited to 'convert.py')
-rw-r--r--convert.py32
1 files changed, 24 insertions, 8 deletions
diff --git a/convert.py b/convert.py
index aad7114..84efda4 100644
--- a/convert.py
+++ b/convert.py
@@ -18,16 +18,16 @@
# adic_long with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-def convert(number, uni1, uni2, type_u):
- dic = {}
+dic = {}
- dic_long = {"Metro": 1, "Yarda": 1.09361, "Pie": 3.28084, "Brazas": 0.5468}
- vol = {}
- area = {}
- peso = {}
- vel = {}
- time = {}
+dic_long = {"Metro": 1, "Yarda": 1.09361, "Pie": 3.28084, "Brazas": 0.5468}
+vol = {}
+area = {}
+peso = {}
+vel = {}
+time = {}
+def convert(number, uni1, uni2, type_u):
if type_u == "dic_long":
dic = dic_long
elif type_u == "vol":
@@ -44,3 +44,19 @@ def convert(number, uni1, uni2, type_u):
unidad = number * dic[uni1]
return unidad * dic[uni2]
+
+def return_list(type_u):
+ if type_u == "dic_long":
+ dic = dic_long
+ elif type_u == "vol":
+ dic = vol
+ elif type_u == "area":
+ dic = area
+ elif type_u == "peso":
+ dic = peso
+ elif type_u == "vel":
+ dic = vel
+ elif type_u == "time":
+ dic = time
+
+ return dic.key()