View Single Post
Old 10-27-2014, 03:38 AM   #3
KoopaOne
Austrian Bookworm
KoopaOne ought to be getting tired of karma fortunes by now.KoopaOne ought to be getting tired of karma fortunes by now.KoopaOne ought to be getting tired of karma fortunes by now.KoopaOne ought to be getting tired of karma fortunes by now.KoopaOne ought to be getting tired of karma fortunes by now.KoopaOne ought to be getting tired of karma fortunes by now.KoopaOne ought to be getting tired of karma fortunes by now.KoopaOne ought to be getting tired of karma fortunes by now.KoopaOne ought to be getting tired of karma fortunes by now.KoopaOne ought to be getting tired of karma fortunes by now.KoopaOne ought to be getting tired of karma fortunes by now.
 
KoopaOne's Avatar
 
Posts: 141
Karma: 2138662
Join Date: Oct 2007
Location: Austria
Device: Pocketbook Inkpad 4
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)

Last edited by KoopaOne; 10-27-2014 at 04:25 AM.
KoopaOne is offline   Reply With Quote