View Single Post
Old 03-11-2011, 02:50 PM   #3
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by user_none View Post
This has nothing to do with your question, but why are you tracing a MetaInformation inside of your SeriesBook class instead of making it a subclass? This would allow you to pass the SeriesBook in places a MetaInformation can be used. This construct should provide you with cleaner code that is easier to work with.
It's a good question. The main reason was that given in the comments for the class, of keeping the methods on the class to a minimum because of all that funky lookup stuff it does when class attributes are requested. I figured I would be much safer just wrapping it in the way I did in case one of my attributes conflicted with some future Calibre column name or whatever. It's not that big of a deal to pass seriesBook.mi instead of seriesBook to a function and sounded safer.

Besides which, the call to db.get_metadata is going to give me mi instances which is my normal starting point for the data. So I would have the problem of coercing one of those into a SeriesBook class?
kiwidude is offline   Reply With Quote