Currently the method looks like this:
Code:
def render(self, encoding='utf-8'):
for meta in self.raster_cover_path(self.metadata):
# Ensure that the name attribute occurs before the content
# attribute. Needed for Nooks.
a = meta.attrib
c = a.get('content', None)
if c is not None:
del a['content']
a['content'] = c
The above code switches just "name" and "content" within one metadata line, right? So how would i delete a metadata line and move it to the end?
I simply want these two lines to be at the end:
Code:
<meta name="calibre:series" content="eBook Testdateien"/>
<meta name="calibre:series_index" content="1.0"/>
how would that code look like? I tried this, but nothing happens ...
Code:
def render(self, encoding='utf-8'):
for meta in self.raster_cover_path(self.metadata):
# Ensure that the name attribute occurs before the content
# attribute. Needed for Nooks.
a = meta.attrib
c = a.get('content', None)
if c is not None:
del a['content']
a['content'] = c
#Ensure that the Series Stuff is at the end of the metadata
# Needed for Pocketbooks
d = a.get('name', None)
if d == 'calibre:series' or d == 'calibre:series_index':
self.metadata.append(meta)