Add a non-breaking space between number and unit
This commit is contained in:
parent
924fc37f48
commit
f2b0bf42c6
@ -4178,26 +4178,26 @@ Out of memory: Killed process 651 (unattended-upgr) total-vm:108020kB, anon-rss:
|
|||||||
|
|
||||||
if item.endswith("_pages") and isinstance(content, int):
|
if item.endswith("_pages") and isinstance(content, int):
|
||||||
if content == 1:
|
if content == 1:
|
||||||
content = "{} page".format(content)
|
content = "{} page".format(content)
|
||||||
else:
|
else:
|
||||||
content = "{} pages".format(content)
|
content = "{} pages".format(content)
|
||||||
|
|
||||||
if item.endswith("_bytes") and isinstance(content, int):
|
if item.endswith("_bytes") and isinstance(content, int):
|
||||||
if content == 1:
|
if content == 1:
|
||||||
content = "{} Byte".format(content)
|
content = "{} Byte".format(content)
|
||||||
else:
|
else:
|
||||||
content = "{} Bytes".format(content)
|
content = "{} Bytes".format(content)
|
||||||
|
|
||||||
if item.endswith("_kb") and isinstance(content, int):
|
if item.endswith("_kb") and isinstance(content, int):
|
||||||
if content == 1:
|
if content == 1:
|
||||||
content = "{} kByte".format(content)
|
content = "{} kByte".format(content)
|
||||||
else:
|
else:
|
||||||
content = "{} kBytes".format(content)
|
content = "{} kBytes".format(content)
|
||||||
|
|
||||||
if item.endswith("_percent") and isinstance(content, int):
|
if item.endswith("_percent") and isinstance(content, int):
|
||||||
content = "{}%".format(content)
|
content = "{} %".format(content)
|
||||||
|
|
||||||
element.textContent = content
|
element.innerHTML = content
|
||||||
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
show_element("notify_box")
|
show_element("notify_box")
|
||||||
|
7
test.py
7
test.py
@ -237,12 +237,13 @@ class TestInBrowser(TestBase):
|
|||||||
"Total memory in summary not found",
|
"Total memory in summary not found",
|
||||||
)
|
)
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
"94% (31705788 kBytes out of 33519336 kBytes) physical memory"
|
"94 % (31705788 kBytes out of 33519336 kBytes) physical memory"
|
||||||
in explanation.text,
|
in explanation.text,
|
||||||
"Used physical memory in summary not found",
|
"Used physical memory in summary not found",
|
||||||
)
|
)
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
"99% (8343236 kBytes out of 8388604 kBytes) swap space" in explanation.text,
|
"99 % (8343236 kBytes out of 8388604 kBytes) swap space"
|
||||||
|
in explanation.text,
|
||||||
"Used swap space in summary not found",
|
"Used swap space in summary not found",
|
||||||
)
|
)
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
@ -320,7 +321,7 @@ class TestInBrowser(TestBase):
|
|||||||
"Physical and swap memory in summary not found",
|
"Physical and swap memory in summary not found",
|
||||||
)
|
)
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
"9% (209520 kBytes out of 2096632 kBytes) physical memory"
|
"9 % (209520 kBytes out of 2096632 kBytes) physical memory"
|
||||||
in explanation.text,
|
in explanation.text,
|
||||||
"Used physical memory in summary not found",
|
"Used physical memory in summary not found",
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user