View Single Post
Old 03-11-2011, 03:51 PM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,787
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I agree with user_none. You should be using a subclass. You wouldn't be the first. There are subclasses of Metadata in the device drivers.

You can avoid attribute/method collision by prefixing your methods and attributes with something, such as sb_.

Regarding getting instances from get_metadata, do something like:
Code:
class SeriesBook(Metadata):
  def __init__(self, title, author):
    Metadata.__init__(self, title, author)
    ....
chaley is offline   Reply With Quote