From fff064652841569436be13670d57842ff58b2893 Mon Sep 17 00:00:00 2001 From: Cristhofer Travieso Date: Thu, 21 Jun 2012 22:32:39 +0000 Subject: Cambie el codigo para que se mas prolijo --- diff --git a/Convert.py b/Convert.py index a1ef537..bbff36f 100644 --- a/Convert.py +++ b/Convert.py @@ -18,16 +18,31 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + class convert(): - def __init__(self, number, uni1, uni2, type_u, ): + def __init__(self, number, uni1, uni2, type_u): super(convert, self).__init__() - self.list = {"long": {}, - "vol": {}, - "area": {}, - "peso": {}, - "vel": {}, - "time": {}} + self.long = {} + self.vol = {} + self.area = {} + self.peso = {} + self.vel = {} + self.time = {} + + if type_u == "long": + self.dic = self.long + elif type_u == "vol": + self.dic = self.vol + elif type_u == "area": + self.dic = self.area + elif type_u == "peso": + self.dic = self.peso + elif type_u == "vel": + self.dic = self.vel + elif type_u == "time": + self.dic = self.time + + self.a = number * self.dic[uni1] - self.a = number * self.list[type_u][uni1] - return self.a * self.list[type_u][uni2] + return self.a * self.dic[uni2] -- cgit v0.9.1