I am working on the attached plug-in (works, but only reports: under construction), to customize the metadata in the opf file.
Trouble is, when pass it to soup, as
what I get in the plug-in window is (1):
but uncommenting either of the commented-out print() instructions, as:
gives instead (2):
Spoiler:
Code:
Status: success
<metadata xmlns:calibre="http://calibre.kovidgoyal.net/2009/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dc:subject>fiction</dc:subject>
<dc:subject>science fiction</dc:subject>
<dc:identifier id="uuid_id" opf:scheme="uuid">52c38ef6-669b-488c-8307-71d9cc6d3ff5</dc:identifier>
<dc:date>1950-04-15T05:00:00+00:00</dc:date>
<dc:creator opf:file-as="Unknown" opf:role="aut">Stilson, Charles Billings</dc:creator>
<dc:language>en</dc:language>
<meta name="cover" content="cover"/>
<meta name="calibre:timestamp" content="2019-04-03T00:35:53.586000+00:00"/>
<dc:title>Polaris and the Goddess Glorian</dc:title>
<dc:publisher>Distributed Proofreaders Canada</dc:publisher>
<meta name="Sigil version" content="1.2.0"/>
<dc:date xmlns:opf="http://www.idpf.org/2007/opf" opf:event="modification">2020-04-06</dc:date>
</metadata>
soup= <html><body><metadata xmlns:calibre="http://calibre.kovidgoyal.net/2009/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dc:subject>fiction</dc:subject>
<dc:subject>science fiction</dc:subject>
<dc:identifier id="uuid_id" opf:scheme="uuid">52c38ef6-669b-488c-8307-71d9cc6d3ff5</dc:identifier>
<dc:date>1950-04-15T05:00:00+00:00</dc:date>
<dc:creator opf:file-as="Unknown" opf:role="aut">Stilson, Charles Billings</dc:creator>
<dc:language>en</dc:language>
<meta content="cover" name="cover"/>
<meta content="2019-04-03T00:35:53.586000+00:00" name="calibre:timestamp"/>
<dc:title>Polaris and the Goddess Glorian</dc:title>
<dc:publisher>Distributed Proofreaders Canada</dc:publisher>
<meta content="1.2.0" name="Sigil version"/>
<dc:date opf:event="modification" xmlns:opf="http://www.idpf.org/2007/opf">2020-04-06</dc:date>
</metadata>
</body></html>
<dc:creator opf:file-as="Unknown" opf:role="aut">Stilson, Charles Billings</dc:creator> should be list
<dc:creator opf:file-as="Unknown" opf:role="aut">Stilson, Charles Billings</dc:creator> should be whole tag
old author: dc:creator
['Stilson', ' Charles Billings'] authorSort
Charles Billings Stilson authorName
[(<dc:creator opf:file-as="Stilson, Charles Billings" opf:role="aut"> Charles Billings Stilson</dc:creator>, ' Charles Billings Stilson'), (<dc:creator opf:file-as="Stilson, Charles Billings" opf:role="aut"> Charles Billings Stilson</dc:creator>, 'file:asStilson, Charles Billings')]
Done
- It drove me batty, to spot *when* the 'type (2)' report, with tags, would become 'type (1)'--not a single tag in sight--while I hadn't done anything that looked significant (comment/uncomment a print() instruction shouldn't be only cosmetic?)
- Please, am I missing something? Some format instruction to be added in situation (1)?
The internal works (navigation & assignments) seem right, but the soup doesn't look adequate for dropping back into the opf file...
Greatly appreciate any help: (stumped)**3!