check_memory fails if system language is different than EN: fix (#139)
This commit is contained in:
@@ -82,11 +82,9 @@ def check_swap():
|
|||||||
|
|
||||||
|
|
||||||
def check_memory():
|
def check_memory():
|
||||||
full_cmd = "free | grep -i mem | awk 'NR == 1 {print $3/$2*100}'"
|
full_cmd = 'free -b | awk \'NR==2 {printf "%.2f\\n", $3/$2 * 100}\''
|
||||||
memory = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
|
|
||||||
if not memory:
|
|
||||||
full_cmd = "free | grep -i speicher | awk 'NR == 1 {print $3/$2*100}'"
|
|
||||||
memory = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
|
memory = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
|
||||||
|
|
||||||
if memory:
|
if memory:
|
||||||
memory = round(float(memory.decode("utf-8").replace(",", ".")))
|
memory = round(float(memory.decode("utf-8").replace(",", ".")))
|
||||||
else:
|
else:
|
||||||
@@ -287,8 +285,6 @@ def print_measured_values(cpu_load=0, cpu_temp=0, used_space=0, voltage=0, sys_c
|
|||||||
print(output)
|
print(output)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def extract_text(html_string):
|
def extract_text(html_string):
|
||||||
html_string = html.unescape(html_string)
|
html_string = html.unescape(html_string)
|
||||||
text = re.sub('<[^<]+?>', '', html_string)
|
text = re.sub('<[^<]+?>', '', html_string)
|
||||||
|
|||||||
Reference in New Issue
Block a user