X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=unfold%2Fcomposite.py;h=f3d42fc4de125e82d05c5ec51c9d0d7a3b9187b3;hb=f19bceaa080ab47bae751cd0597a9fb32d1b6b4f;hp=9007cdc625d1d8e471c0fb94809f872de4f40bf4;hpb=544e6ac78d490061f848f98adb0e08574b474371;p=myslice.git diff --git a/unfold/composite.py b/unfold/composite.py index 9007cdc6..f3d42fc4 100644 --- a/unfold/composite.py +++ b/unfold/composite.py @@ -1,16 +1,17 @@ from unfold.plugin import Plugin -# this is a simple base class for plugins that contain/arrange a set of other plugins -# sons is expected to be a list of the contained plugins, and -# active_domid is the domid for the one son that should be displayed as active -# some subclasses of Composite, like e.g. Tabs, will not behave as expected -# if a valid active_domid is not provided - class Composite (Plugin): - def __init__ (self, sons=[], active_domid=None, *args, **kwds): + """a simple base class for plugins that contain/arrange a set of other plugins +sons is expected to be a list of the contained plugins, and +active_domid is the domid for the one son that should be displayed as active +some subclasses of Composite, like e.g. Tabs, will not behave as expected +if a valid active_domid is not provided +""" + + def __init__ (self, sons=None, active_domid=None, *args, **kwds): Plugin.__init__ (self, *args, **kwds) - self.sons=sons + self.sons= sons if sons else [] self.active_domid=active_domid # make sure this is valid, unset otherwise, so we always have exactly one active self.check_active_domid()