BTW, just a reminder - and I'm tending to remind anyone that's doing code at the moment - this doesn't mean that you should be registering modules that you don't "own"...
Modules that are outside of your area, should be automatically registered when you simply do: import solaris_install.transfer import solaris_install.targets due to them doing self-registering in their __init__.py files. The idea is that the modules know best what classes they should be registering and consumers of those modules really shouldn't need to care - it should just work, and to use a motto from the Desktop arena - fi...@source - meaning that if a new class is added to a module you don't need to patch all the apps to register it, it should just happen. Thanks, Darren. On 11/ 4/10 09:30 PM, Alok Aggarwal wrote: > Hi Darren, > > I just have a couple of nits: > > cache.py: 293: Can be changed to - > > if 0 < priority < 100: > > __init__.py: 114: s/picke/pickle > > Looks fine otherwise, thanks for making this > change. > > Alok > > On Wed, 3 Nov 2010, Darren Kenny wrote: > >> Hi, >> >> I'd like to request a review for the addition of support for the passing of >> modules to the DataObjectCache.register_class() method. >> >> The explanation is a little long, but I promise the code changes aren't huge >> ;) >> >> If a module is found in the parameters to register_class, then I use the >> 'inspect' module (thanks Drew) to fetch the classes in it, and then I do a >> recursive call to the register_class() method with these classes. >> >> I also discovered that in fetching of the classes, I was getting classes that >> were imported (e.g. DataObject) which I shouldn't be registering, so I check >> that any class to register is actually coming from the module I was asked to >> check. >> >> Matt also noticed an issue with the logging where the log messages weren't >> being >> logged where expected, so I've provided a DataObjectBase.get_logger() class >> method and DataObjectBase.logger property for easy access, so I'm also >> including >> the fix for this. Keith also mentioned this in my original CR, but looks >> like I >> was misunderstanding how the Python logging worked. >> >> I had to implement the logging using class variables since it's desirable to >> log >> from class methods (can_handle, from_xml, etc.) but also because pickle >> didn't >> like if I tried to pickle anything using an instance variable to store the >> reference too. >> >> The webrev can be found at: >> >> http://cr.opensolaris.org/~dkenny/fix.6996768.slim/ >> >> I ran the PyUnit tests for slim, to confirm that things are still working and >> that I've not broken anything. >> >> Thanks, >> >> Darren. >> _______________________________________________ >> caiman-discuss mailing list >> [email protected] >> http://mail.opensolaris.org/mailman/listinfo/caiman-discuss >> _______________________________________________ caiman-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/caiman-discuss

