Author: duncan
Date: Thu Dec 21 23:26:46 2006
New Revision: 8784

Modified:
   branches/rel-1/freevo/src/plugins/df.py

Log:
Performing the calcs before the if blocks, no good reason except checking the 
i18n warnings


Modified: branches/rel-1/freevo/src/plugins/df.py
==============================================================================
--- branches/rel-1/freevo/src/plugins/df.py     (original)
+++ branches/rel-1/freevo/src/plugins/df.py     Thu Dec 21 23:26:46 2006
@@ -56,15 +56,16 @@
         if item.type == 'dir':
             freespace = util.freespace(item.dir)
             totalspace = util.totalspace(item.dir)
+            freespacemb = (freespace / 1024) / 1024
+            freespacegb = freespacemb / 1024
+            totalspacemb = (totalspace / 1024) / 1024
+            totalspacegb = totalspacemb / 1024
+            percentage = freespace * 100.0 / totalspace
 
             if (totalspace > 1073741824): # more than 1024 Mb
-                diskfree = _('%i free of %i Gb total (%i%% free)') % \
-                           ( (((freespace / 1024) / 1024) / 1024),
-                             (((totalspace / 1024) / 1024) / 1024), 
(freespace*100.0/totalspace) )
+                diskfree = _( '%i free of %i GB total (%i%% free)' ) % 
(freespacegb, totalspacegb, percentage)
             else:
-                diskfree = _('%i free of %i Mb total (%i%% free)') % \
-                           ( ((freespace / 1024) / 1024),
-                             ((totalspace / 1024) / 1024), 
(freespace*100.0/totalspace) )
+                diskfree = _( '%i free of %i MB total (%i%% free)' ) % 
(freespacemb, totalspacemb, percentage)
             return  [ ( self.dud, diskfree) ]
         else:
             return []

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to