Author: jerome
Date: 2009-04-15 14:32:06 +0200 (Wed, 15 Apr 2009)
New Revision: 4519
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-system/trunk/tuxdroid-gadget-system/executables/tuxdroid-gadget-system.py
Log:
* Fixed a bug with some locales.
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-system/trunk/tuxdroid-gadget-system/executables/tuxdroid-gadget-system.py
===================================================================
---
software_suite_v2/software/gadgets/tuxdroid-gadget-system/trunk/tuxdroid-gadget-system/executables/tuxdroid-gadget-system.py
2009-04-15 12:08:36 UTC (rev 4518)
+++
software_suite_v2/software/gadgets/tuxdroid-gadget-system/trunk/tuxdroid-gadget-system/executables/tuxdroid-gadget-system.py
2009-04-15 12:32:06 UTC (rev 4519)
@@ -201,11 +201,20 @@
totalIndex = result.find("Total Physical Memory")
totalAvailable = result.find("Available Physical Memory")
totalMem = result.find("MB", totalIndex, totalAvailable)
- totalMem = result[ totalIndex + len("Total Physical Memory:") :
totalMem ]
+ totalMem = result[ totalIndex + len("Total Physical Memory:") :
totalMem ]
+
freeMem = result.find("MB", totalAvailable)
freeMem = result[ totalAvailable + len("Available Physical Memory:") :
freeMem ]
+
totalMem = string.replace(totalMem.strip(), ".", "")
freeMem = string.replace(freeMem.strip(), ".", "")
+
+ totalMem = string.replace(totalMem.strip(), ",", "")
+ freeMem = string.replace(freeMem.strip(), ",", "")
+
+ totalMem = string.replace(totalMem.strip(), "'", "")
+ freeMem = string.replace(freeMem.strip(), "'", "")
+
value = str(float( float(int(totalMem) - int(freeMem)) /
float(totalMem) ) * 100)
if value.find("."):
value = value[ : value.find(".")]
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn