def detect_worksheets(archive):
 content_types = read_content_types(archive)
 valid_sheets = dict(((path, ct) for (ct, path) in content_types if (ct == VALID_WORKSHEET)))
 rels = dict(read_rels(archive))
 for sheet in read_sheets(archive):
  rel = rels[sheet['id']]
  rel['title'] = sheet['name']
  rel['sheet_id'] = sheet['sheetId']
  rel['state'] = sheet.get('state', 'visible')
  if ((('/' + rel['path']) in valid_sheets) or ('worksheets' in rel['path'])):
   (yield rel)

def detect_worksheets ( archive ) : content_types = read_content_types ( archive ) valid_sheets = dict ( ( ( path , ct ) for ( ct , path ) in content_types if ( ct == VALID_WORKSHEET ) ) ) rels = dict ( read_rels ( archive ) ) for sheet in read_sheets ( archive ) : rel = rels [ sheet [ 'id' ] ] rel [ 'title' ] = sheet [ 'name' ] rel [ 'sheet_id' ] = sheet [ 'sheetId' ] rel [ 'state' ] = sheet . get ( 'state' , 'visible' ) if ( ( ( '/' + rel [ 'path' ] ) in valid_sheets ) or ( 'worksheets' in rel [ 'path' ] ) ) : ( yield rel )
return a list of worksheets .