diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2010-05-27 05:22:35 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-05-27 12:11:57 -0400 |
commit | b530a23f0442be322b1717e6dbce2bd502634cb4 (patch) | |
tree | 59c00e404b3d36af4c8d45fe5e0f5085b9cc867c | |
parent | 6bf94a1fa0441c60142cd3aa9c6e0c42cd7ce402 (diff) |
tracecmd.py: Complete Event dict abstraction
Apart from being immutable, Event instances
should behave like a dict. Use the DictMixin
to make them support the remaining features.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | tracecmd.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tracecmd.py b/tracecmd.py index ad80ccd..75a639d 100644 --- a/tracecmd.py +++ b/tracecmd.py | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | from functools import update_wrapper | 21 | from functools import update_wrapper |
22 | from ctracecmd import * | 22 | from ctracecmd import * |
23 | from UserDict import DictMixin | ||
23 | 24 | ||
24 | """ | 25 | """ |
25 | Python interface to the tracecmd library for parsing ftrace traces | 26 | Python interface to the tracecmd library for parsing ftrace traces |
@@ -50,7 +51,7 @@ def cached_property(func, name=None): | |||
50 | self.__cached_properties.pop(name, None) | 51 | self.__cached_properties.pop(name, None) |
51 | return property(_get, None, _del) | 52 | return property(_get, None, _del) |
52 | 53 | ||
53 | class Event(object): | 54 | class Event(object, DictMixin): |
54 | """ | 55 | """ |
55 | This class can be used to access event data | 56 | This class can be used to access event data |
56 | according to an event's record and format. | 57 | according to an event's record and format. |