def get_comments_file(worksheet_path, archive, valid_files):
 sheet_codename = os.path.split(worksheet_path)[(-1)]
 rels_file = (((PACKAGE_WORKSHEET_RELS + '/') + sheet_codename) + '.rels')
 if (rels_file not in valid_files):
  return None
 rels_source = archive.read(rels_file)
 root = fromstring(rels_source)
 for i in root:
  if (i.attrib['Type'] == COMMENTS_NS):
   comments_file = os.path.split(i.attrib['Target'])[(-1)]
   comments_file = ((PACKAGE_XL + '/') + comments_file)
   if (comments_file in valid_files):
    return comments_file
 return None

def get_comments_file ( worksheet_path , archive , valid_files ) : sheet_codename = os . path . split ( worksheet_path ) [ ( - 1 ) ] rels_file = ( ( ( PACKAGE_WORKSHEET_RELS + '/' ) + sheet_codename ) + '.rels' ) if ( rels_file not in valid_files ) : return None rels_source = archive . read ( rels_file ) root = fromstring ( rels_source ) for i in root : if ( i . attrib [ 'Type' ] == COMMENTS_NS ) : comments_file = os . path . split ( i . attrib [ 'Target' ] ) [ ( - 1 ) ] comments_file = ( ( PACKAGE_XL + '/' ) + comments_file ) if ( comments_file in valid_files ) : return comments_file return None
returns the xml filename in the archive which contains the comments for the spreadsheet with codename sheet_codename .