summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-09-01 12:24:27 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-09-01 12:26:22 -0300
commit487c7d8aaf463efa6561ec0ca8a5f25cb668c7c9 (patch)
tree5c296c56977abf97f414bb66ac87ae7fd3018277
parent0e5f12f00b3e6bf7b1f3ead30b04876252ea4f1b (diff)
downloadpython-linux-procfs-487c7d8aaf463efa6561ec0ca8a5f25cb668c7c9.tar.gz
smaps: Add __len__ method
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-xprocfs/procfs.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/procfs/procfs.py b/procfs/procfs.py
index dd9778d..21d2143 100755
--- a/procfs/procfs.py
+++ b/procfs/procfs.py
@@ -777,6 +777,9 @@ class smaps:
self.entries.append(smaps_lib(lines))
return line
+ def __len__(self):
+ return len(self.entries)
+
def __getitem__(self, index):
return self.entries[index]