Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAgustin Zubiaga <aguz@sugarlabs.org>2012-08-22 20:17:31 (GMT)
committer Cristhofer Travieso <cristhofert97@gmail.com>2012-08-22 18:26:34 (GMT)
commitc8a88137ba78809a3a57367c5e3c4070a0065ac9 (patch)
treea451289efe48f94e076aeb03045904feaa31e08d
parent595934e69ee41cc15079f0fdb757eb1244ad5b75 (diff)
Code style fixes.
PyLint rate: 8.67/10 Signed-off-by: Agustin Zubiaga <aguz@sugarlabs.org> Signed-off-by: Cristhofer Travieso <cristhofert97@gmail.com>
-rw-r--r--activity.py16
-rw-r--r--convert.py13
2 files changed, 14 insertions, 15 deletions
diff --git a/activity.py b/activity.py
index 810e3b8..4fcf173 100644
--- a/activity.py
+++ b/activity.py
@@ -58,7 +58,7 @@ class ConvertActivity(activity.Activity):
self.combo2.pack_start(cell, True)
self.combo2.add_attribute(cell, 'markup', 0)
self.combo2.connect('changed', self._call)
-
+
self.label_box = gtk.HBox()
self.adjustment = gtk.Adjustment(1.0, 1.0, 10.0 ** 20.0, 0.1, 1.0)
@@ -90,11 +90,11 @@ class ConvertActivity(activity.Activity):
self.label_box.add(self.label)
spin_box.pack_start(self.convert_btn, False, False, 20)
self._canvas.pack_end(self.label_info, False, False, 2)
- self._canvas.pack_end(title_info, False, False, 2)
+ self._canvas.pack_end(title_info, False, False, 2)
self.set_canvas(self._canvas)
- #Toolbar
+ # Toolbar
toolbarbox = ToolbarBox()
activity_button = ActivityToolbarButton(self)
@@ -175,7 +175,8 @@ class ConvertActivity(activity.Activity):
convert_value = str(self.convert())
decimals = str(len(convert_value.split('.')[-1]))
- new_convert = locale.format('%.' + decimals + 'f', float(convert_value))
+ new_convert = locale.format('%.' + decimals + 'f', float(
+ convert_value))
text = '%s ~ %s' % (new_value, new_convert)
self.label.set_text(text)
@@ -198,7 +199,7 @@ class ConvertActivity(activity.Activity):
if len(self.dic[x]) == 3:
symbol = self.dic[x][-1]
symbol = '<sup><b>%s</b></sup>' % symbol
-
+
self._liststore1.append(['%s%s' % (x, symbol)])
self._liststore2.append(['%s%s' % (x, symbol)])
self.combo1.set_active(0)
@@ -228,7 +229,8 @@ class ConvertActivity(activity.Activity):
try:
value = self.dic[util][0] * self.dic[to_util][1]
self.label_info.set_text('%s x %s = %s' % (str(util),
- str(value), str(to_util)))
+ str(value),
+ str(to_util)))
except KeyError:
pass
@@ -247,5 +249,3 @@ class ConvertActivity(activity.Activity):
unit = self._get_active_text(self.combo1)
to_unit = self._get_active_text(self.combo2)
return convert.convert(number, unit, to_unit, self.dic)
-
-
diff --git a/convert.py b/convert.py
index 435d182..7270b76 100644
--- a/convert.py
+++ b/convert.py
@@ -24,7 +24,7 @@ lenght = {_('Meters (m)'): (1, 1),
_('Decimeter (dm)'): (0.1, 10),
_('Decameter'): (10, 0.1),
_('Hectometers (hm)'): (100, 0.01),
- _('Chains'): (20.1, 0.0497512437811),
+ _('Chains'): (20.1, 0.0497512437811),
_('Ell'): (1.14, 0.877192982456),
_('Ems (Pica)'): (0.00422, 236.966824645),
_('Fathoms'): (1.83, 0.546448087432),
@@ -48,23 +48,23 @@ area = {_('Meter'): (1, 1, 2),
_('Acre'): (4046.86, 0.00024710516301527604)
}
-weight = {_('Gram'): (1, 1),
+weight = {_('Gram'): (1, 1),
_('Kilogram'): (1000, 0.001),
- _('Miligram'): (0.001, 1000.0000000000001),
+ _('Miligram'): (0.001, 1000.0000000000001),
_('Ton'): (1000000, 0.000001),
_('Pound'): (453.592, 0.0022046244201837776),
- _('Ounce'): (28.3495, 0.03527399072294044),
+ _('Ounce'): (28.3495, 0.03527399072294044),
_('Carrat'): (0.2, 5)
}
-volume = {_('Meter'): (1, 1, 3),
+volume = {_('Meter'): (1, 1, 3),
_('Foot'): (0.0283168, 35.31472482766414, 3),
_('Yard'): (0.764555, 1.307950376362721, 3),
_('Inch'): (0.0000163871, 61023.61003472243, 3),
_('Kilometer'): (1000000000, 1e-9, 3),
_('Mile'): (4168180000, 2.399128636479231e-10, 3),
_('Centimeter'): (0.000001, 1000000, 3),
- _('Milimeter'): (1e-9, 999999999.9999999, 3),
+ _('Milimeter'): (1e-9, 999999999.9999999, 3),
_('Liter'): (0.001, 1000),
_('Milliliter'): (0.000001, 1000000, 3),
_('Pint'): (0.000473176, 2113.378531455526),
@@ -102,4 +102,3 @@ time = {_('Day'): (1, 1),
def convert(number, unit, to_unit, dic):
main_unit = number * dic[unit][0]
return main_unit * dic[to_unit][1]
-