mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-10-30 18:22:25 -04:00 
			
		
		
		
	Speed up parsing of OPF files
This commit is contained in:
		
							parent
							
								
									4a74faa6e5
								
							
						
					
					
						commit
						8dd35bc55c
					
				| @ -272,6 +272,10 @@ class Spine(ResourceCollection): | ||||
|             self.id = idfunc(self.path) | ||||
|             self.idref = None | ||||
| 
 | ||||
|         def __repr__(self): | ||||
|             return 'Spine.Item(path=%r, id=%s, is_linear=%s)' % \ | ||||
|                     (self.path, self.id, self.is_linear) | ||||
| 
 | ||||
|     @staticmethod | ||||
|     def from_opf_spine_element(itemrefs, manifest): | ||||
|         s = Spine(manifest) | ||||
| @ -280,7 +284,7 @@ class Spine(ResourceCollection): | ||||
|             if idref is not None: | ||||
|                 path = s.manifest.path_for_id(idref) | ||||
|                 if path: | ||||
|                     r = Spine.Item(s.manifest.id_for_path, path, is_path=True) | ||||
|                     r = Spine.Item(lambda x:idref, path, is_path=True) | ||||
|                     r.is_linear = itemref.get('linear', 'yes') == 'yes' | ||||
|                     r.idref = idref | ||||
|                     s.append(r) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user