On Tue, 2013-05-28 at 11:02 -0400, Chris Lumens wrote:
> > 3. it would be nice if there were some abstraction of the
callback
> > handling in the DeviceAction classes
> Yeah, I agree with that. But I'm not sure there is any nice way how to
> do it. I was thinking about all actions calling their "pre" and
"post"
> callbacks with names derived from their class names, but that would be a
> hack, I think. Any better suggestions? Maybe adding some _pre_callback
> and _post_callback class attributes holding the names of the callbacks
> to the actions?
Do you envision adding a bunch more callbacks later? Do you envison
that other consumers of blivet will want different sets of callbacks?
You could perhaps do a base class that defines callback methods, then a
subclass for your specific callbacks, then instantiate that.
That might be the
right way to go, thanks! I'll try to think it through
and suggest a modified version of these patches.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic