def find_cover_page(container):
 ver = container.opf_version_parsed
 if (ver.major < 3):
  mm = container.mime_map
  guide_type_map = container.guide_type_map
  for (ref_type, name) in guide_type_map.iteritems():
   if ((ref_type.lower() == u'cover') and (mm.get(name, u'').lower() in OEB_DOCS)):
    return name
 else:
  for name in container.manifest_items_with_property(u'calibre:title-page'):
   return name

def find_cover_page ( container ) : ver = container . opf_version_parsed if ( ver . major < 3 ) : mm = container . mime_map guide_type_map = container . guide_type_map for ( ref_type , name ) in guide_type_map . iteritems ( ) : if ( ( ref_type . lower ( ) == u'cover' ) and ( mm . get ( name , u'' ) . lower ( ) in OEB_DOCS ) ) : return name else : for name in container . manifest_items_with_property ( u'calibre:title-page' ) : return name
find a document marked as a cover in the opf .