[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[PATCH] Add a get() method to Flags, since it pretends to be a dictionary.
- From: Chris Lumens <clumens redhat com>
- To: anaconda-devel-list redhat com
- Cc:
- Subject: [PATCH] Add a get() method to Flags, since it pretends to be a dictionary.
- Date: Thu, 5 Mar 2009 09:41:02 -0500
---
flags.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/flags.py b/flags.py
index 2d77bd7..8dbcc9f 100644
--- a/flags.py
+++ b/flags.py
@@ -36,6 +36,12 @@ class Flags:
else:
raise AttributeError, attr
+ def get(self, attr, val=None):
+ if self.__dict__['flags'].has_key(attr):
+ return self.__dict__['flags'][attr]
+ else:
+ return val
+
def createCmdlineDict(self):
cmdlineDict = {}
cmdline = open("/proc/cmdline", "r").read().strip()
--
1.6.1.3
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]