summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurie Clark-Michalek <bluepeppers@archlinux.us>2011-06-12 17:06:29 +0100
committerLaurie Clark-Michalek <bluepeppers@archlinux.us>2011-06-12 17:06:29 +0100
commit8ed5def21c30df5e98c22b34d863862bbc4be21b (patch)
treeba6af3390fe1fb25c1e3d90b31ce445007485148
parentb8a72dc1c5e91dbb42efe95be9841a6582d2e867 (diff)
Fixed locale issue with decimal point.
-rwxr-xr-xarchey311
1 files changed, 9 insertions, 2 deletions
diff --git a/archey3 b/archey3
index 7a144ed..9fb6b58 100755
--- a/archey3
+++ b/archey3
@@ -227,9 +227,16 @@ class fsDisplay(display):
raise
def format_output(self, instring):
+ try:
+ decimal_point = self.call_command(
+ 'locale -ck decimal_point').split('\n')[1].split('=')[1]
+ except Exception as e:
+ self.logger.warning('Could not determine locale decimal point,' +
+ 'defaulting to \'.\', failed with error {0}'.format(e))
+ decimal_point = '.'
values = [line for line in instring.split('\n') if line][1].split()
- used = values[3]
- total = values[2]
+ used = values[3].replace(decimal_point, '.')
+ total = values[2].replace(decimal_point, '.')
fstype = values[1]
conversion_type = self.config.get('fs', 'unit', fallback="si").lower()
conversions = self.conversions[conversion_type]