summaryrefslogtreecommitdiff
diff options
authorSylvain Pineau <sylvain.pineau@canonical.com>2020-07-13 13:18:23 +0200
committerSylvain Pineau <sylvain.pineau@canonical.com>2020-07-13 13:18:23 +0200
commit74784a1e1282c921b4d85cc2def4688f35897cf1 (patch)
tree627851a347f516505d9333549cf4d3fbc0b8d575
parentd9f8c41df90a2e64908c93c9fd55bce987a2099c (diff)
bin:memory_info: Deleted
-rwxr-xr-xbin/memory_info35
1 files changed, 0 insertions, 35 deletions
diff --git a/bin/memory_info b/bin/memory_info
deleted file mode 100755
index 708c22d..0000000
--- a/bin/memory_info
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env python3
-
-import re
-import sys
-
-
-def get_meminfo():
- meminfo = {}
- for line in open("/proc/meminfo").readlines():
- match = re.match(r"(.*):\s+(.*)", line)
- if match:
- key = match.group(1)
- value = match.group(2)
- meminfo[key] = value
-
- return meminfo
-
-
-def main(args):
- meminfo = get_meminfo()
- amount, units = meminfo["MemTotal"].split()
-
- amount = float(amount)
- next_units = {'kB': 'MB',
- 'MB': 'GB'}
-
- while amount > 1024:
- amount = amount / 1024
- units = next_units[units]
-
- print("%.1f %s" % (amount, units))
- return 0
-
-if __name__ == "__main__":
- sys.exit(main(sys.argv[1:]))