You cannot create a new output class for PDB. You must work within the current class. Calibre is file type based. There is no way to associate multiple output classes with a single format.
calibre.ebooks.pdb.output.PDBOutput.convert
This takes the PDB identity and checks if there is a writer associated with it. The writer used for output is taken from calibre.ebooks.pdb.FORMAT_WRITERS. You would need to add a key and associated class reference to this dictionary to enable writing a specific PDB type. Also if you are adding a new identity be sure to add it to calibre.ebooks.pdb.IDENTITY_TO_NAME if it is not already in that list.
calibre.ebooks.pdb.output.PDBInput uses the same design for adding PDB readers.
Add a new module to the PDB module. You will need to put your writer class in a file named writer.py. The writer must be a subclass of calibre.ebooks.pdb.formatreader.FormatReader. Your subclass must implement __init__ and extract_content. Look at the palmdoc module for a simple example.
|