Index: /main/waeup.kofa/trunk/CHANGES.txt
===================================================================
--- /main/waeup.kofa/trunk/CHANGES.txt	(revision 11823)
+++ /main/waeup.kofa/trunk/CHANGES.txt	(revision 11824)
@@ -47,4 +47,6 @@
 * Allow external checks of system load before performing expensive
   actions.
+
+* Add helper to allow `meminfo` checks for cached memory, etc.
 
 
Index: /main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py	(revision 11823)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py	(revision 11824)
@@ -773,2 +773,33 @@
         return linenum + 1
     return None
+
+
+class MemInfo(dict):
+    """A dict with access to its items like if they are attributes.
+    """
+    __getattr__ = dict.__getitem__
+    __setattr__ = dict.__setitem__
+    __delattr__ = dict.__delitem__
+
+
+def get_meminfo(src="/proc/meminfo"):
+    """Get local memory info as provided in /proc/meminfo.
+
+    Entries in /proc/meminfo are available as MemInfo attributes.
+
+    By default we lookup a file /proc/meminfo. Another path can be
+    lines = open(src, 'r').read()passed in as `src` parameter. In this
+    case `src` must be a regular file and contain meminfo-style data.
+
+    If the given `src` (or `/proc/meminfo`) are not available, `None`
+    lines = open(src, 'r').read()is returned.
+    """
+    if not os.path.isfile(src):
+        return None
+    lines = open(src, 'r').read().splitlines()
+    result = MemInfo()
+    for line in lines:
+        key, value = line.split(':', 1)
+        value = int(value.split(' kB', 1)[0])
+        result[key] = value
+    return result
Index: /main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_helpers.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_helpers.py	(revision 11823)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_helpers.py	(revision 11824)
@@ -537,4 +537,51 @@
         self.assertEqual(helpers.check_csv_charset(csv), 2)
 
+
+class MemInfoTestCase(unittest.TestCase):
+
+    def test_getsetattrs(self):
+        # we can set/get attributes of MemInfos
+        info = helpers.MemInfo()
+        self.assertRaises(
+            KeyError, info.__getattr__, 'foo')
+        info['foo'] = 'bar'
+        assert info.foo == 'bar'
+        info.bar = 'baz'
+        assert info.bar == 'baz'
+
+    def test_getattrs(self):
+        # we can del attributes
+        info = helpers.MemInfo()
+        info['foo'] = 'bar'
+        del info['foo']
+        self.assertRaises(
+            KeyError, info.__getattr__, 'foo')
+        info['bar'] = 'baz'
+        del info.bar
+        self.assertRaises(
+            KeyError, info.__getattr__, 'bar')
+
+
+class GetMemInfoTestCase(unittest.TestCase):
+
+    @unittest.skipIf(
+        not os.path.exists('/proc/meminfo'),
+        reason="No /proc/meminfo found.")
+    def test_system(self):
+        info = helpers.get_meminfo()
+        assert isinstance(info, helpers.MemInfo)
+
+    def test_values(self):
+        sample_meminfo = os.path.join(
+            os.path.dirname(__file__), 'sample_meminfo')
+        info = helpers.get_meminfo(src=sample_meminfo)
+        assert info.Cached == 1013816
+
+    def test_invalid_src(self):
+        # we cope with invalid src files
+        info = helpers.get_meminfo(src="nOt-ExIsTiNg-FiLe")
+        assert info is None
+
+
 def test_suite():
     suite = unittest.TestSuite()
@@ -554,4 +601,6 @@
         SimpleHelpersTestCase,
         CheckCSVCharsetTestCase,
+        MemInfoTestCase,
+        GetMemInfoTestCase,
         ]:
         suite.addTests(
