diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-09-01 12:24:27 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-09-01 12:26:22 -0300 |
commit | 487c7d8aaf463efa6561ec0ca8a5f25cb668c7c9 (patch) | |
tree | 5c296c56977abf97f414bb66ac87ae7fd3018277 | |
parent | 0e5f12f00b3e6bf7b1f3ead30b04876252ea4f1b (diff) | |
download | python-linux-procfs-487c7d8aaf463efa6561ec0ca8a5f25cb668c7c9.tar.gz |
smaps: Add __len__ method
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-x | procfs/procfs.py | 3 |
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] |