diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-10-02 13:28:37 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-10-02 13:28:37 -0300 |
commit | 1a4c647e7b47d904f183d3083bd6068ed8bfb011 (patch) | |
tree | 761c0481b2c6512e58067b1f366e1ac9274bb44a | |
parent | eaa849f6cb987981063445fd77425557466347f3 (diff) | |
download | python-linux-procfs-1a4c647e7b47d904f183d3083bd6068ed8bfb011.tar.gz |
cmdline: Add dict methods
So that we can use procfs.cmdline()["BOOT_IMAGE"], for instance.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-x | procfs/procfs.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/procfs/procfs.py b/procfs/procfs.py index 86813a1..10aad28 100755 --- a/procfs/procfs.py +++ b/procfs/procfs.py @@ -651,6 +651,12 @@ class cmdline: f.close() + def __getitem__(self, key): + return self.options[key] + + def keys(self): + return self.options.keys() + class cpuinfo: """ Dictionary with information about CPUs in the system. |