Apologies for the late response. Had downloaded the Calibre python source code and have been burried in the debug window for the better part of the weekend trying to find a solution for the accented characters in filenames. (keep in mind I still know very, very little about python, so am totally not confident using it, let alone adapting existing code). At least that problem is solved, still not much the wiser but did find a way that it didn't complain and that's the main thing.
Ok, back to above issue. What I am trying to do is to lift as much as I can of the metadata out of my books I still got in my Stanza library. Part of this is stored in Stanza's own internal db, parts within the epubs themselves.
Since I have no idea upfront what is stored in the books themselves I am trying to loop through each of the metadata keys I get back from all_field_keys(). And because I have no clue about what content there might be associated with a key (I can assume from the type of key, but some keys can have 0,1 or more entries as in a set. e.g. the User Metadata if I am not mistaken.
All that is fairly straight forward. I would just have expected that if I query which attributes are present in a mi, and then ask for one the I see in the returned list, I get told it ain't there...that just don't make sense to me. Even if it were empty then I would have expected simply a return value of {} or None if it is listed as one of the present attributes.
just as I cannot wrap my head around why a statement with a checking nature would fail where as a statement that actively retrieves (presumably without first checking, why else would there be an hasattr), just goes and pulls what it is supposed to pull. (i.e. the urn attribute)
|