From 9a7bf3bffb2a8459e66b988aaff53611723b5ab4 Mon Sep 17 00:00:00 2001 From: pepperpepperpepper Date: Sun, 29 Nov 2015 17:43:44 -0800 Subject: required=0, -e commit message for your changes. Lines starting --- ricky/param/option.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ricky/param/option.py (limited to 'ricky/param/option.py') diff --git a/ricky/param/option.py b/ricky/param/option.py new file mode 100644 index 0000000..0cbd505 --- /dev/null +++ b/ricky/param/option.py @@ -0,0 +1,16 @@ +""" +Base option class...essentially a dictionary +but attributes can be accessed with a dot +""" + + +class Option(dict): + def __init__(self, **kwargs): + super(Option, self).__init__(**kwargs) + + def __getattr__(self, attr): + return self.get(attr) + + __setattr__ = dict.__setitem__ + + __delattr__ = dict.__delitem__ -- cgit v1.2.3-70-g09d2