[damned-lies] Just make one call to pot_size on PoFile.{tr, fu, un}_percentage methods
- From: Gil Forcada Codinachs <gforcada src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Just make one call to pot_size on PoFile.{tr, fu, un}_percentage methods
- Date: Fri, 21 Oct 2011 14:41:51 +0000 (UTC)
commit 35077bbdf39939e539d981f80402933b313f556d
Author: Gil Forcada <gforcada gnome org>
Date: Sat Oct 15 21:31:07 2011 +0200
Just make one call to pot_size on PoFile.{tr,fu,un}_percentage methods
stats/models.py | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index 840c327..f67e4e2 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -1235,22 +1235,25 @@ class PoFile(models.Model):
return self.figures and len(self.figures) or 0
def tr_percentage(self):
- if self.pot_size() == 0:
+ pot_size = self.pot_size()
+ if pot_size == 0:
return 0
else:
- return int(100*self.translated/self.pot_size())
+ return int(100*self.translated/pot_size)
def fu_percentage(self):
- if self.pot_size() == 0:
+ pot_size = self.pot_size()
+ if pot_size == 0:
return 0
else:
- return int(100*self.fuzzy/self.pot_size())
+ return int(100*self.fuzzy/pot_size)
def un_percentage(self):
- if self.pot_size() == 0:
+ pot_size = self.pot_size()
+ if pot_size == 0:
return 0
else:
- return int(100*self.untranslated/self.pot_size())
+ return int(100*self.untranslated/pot_size)
def update_stats(self):
stats = utils.po_file_stats(self.path, msgfmt_checks=False)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]