I do a lot of my work in linux and am used to the linux terminal, but not so familiar with python and its way of invocation, that's why I wondered whether this was possible from within bash.
But OK, it looks like I will have to do this with python, and it will be a good exercise for me. I haven't used python for years, and never needed to invoke a python script and passing a file as a reference to it. I therefore put forward a few more questions before I dive into this.
1) I will re-use apnx.py from Calibre:
http://bazaar.launchpad.net/~kovid/c...kindle/apnx.py
How would I invoke this python script from the command line and passing the path of the mobi file for which I would like to generate an apnx file? The script provides these methods and classes:
class APNXBuilder(object)
def write_apnx(self, mobi_file_path, apnx_path, accurate=True, page_count=0)
def generate_apnx(self, pages, apnx_meta)
def get_pages_exact(self, mobi_file_path, page_count)
def get_pages_fast(self, mobi_file_path)
def get_pages_accurate(self, mobi_file_path)
but it has no body for importing and reading the file. I guess I shall have to create my own script for reading the path argument and pass that to the function
in one way or another. Am I on the right track?
2) Is apnx only for mobi files, or for azw3 files as well? I see calibre generates them for mobi files, but cannot find azw3 files in here?
3) Does calibre always create its own apnx file when sinding to device, even when there is an apnx present in the folder together with the mobi file?