changeset 263:077c2ce02f93

Refactor ProjectList setting the total_time Devide _total_time into a method that calculates the current total time and a method that actually shows the total time in the footer.
author Björn Ricks <bjoern.ricks@intevation.de>
date Thu, 11 Apr 2013 12:39:25 +0200
parents 438f6ce81e3d
children 915456b53f34
files getan/view.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/getan/view.py	Thu Apr 11 12:07:16 2013 +0200
+++ b/getan/view.py	Thu Apr 11 12:39:25 2013 +0200
@@ -153,7 +153,7 @@
         self.set_raw_rows(rows)
         super(ProjectList, self).__init__("Projects", rows)
         self.create_node_rows()
-        self._total_time()
+        self.show_total_time()
 
     def load_rows(self, rows):
         self.set_raw_rows(rows)
@@ -194,7 +194,11 @@
     def _get_project_sort_key(self, proj):
         return getattr(proj, self.PROJECT_MODES[self.project_mode])
 
-    def _total_time(self):
+    def show_total_time(self):
+        self.total_time()
+        self.reset_footer()
+
+    def total_time(self):
         if not self.rows:
             self.set_footer_text("", "project_footer")
             return
@@ -211,7 +215,6 @@
     def set_footer_info(self, text, attr):
         logger.debug("ProjectList: set_footer_info to '%s'" % text)
         self._footer_info = (text, attr)
-        self.set_footer_text(text, attr, False)
 
     def reset_footer(self):
         if not self.rows:
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)