def METHOD_NAME(self, fname):
    """ Comment out a file.
    Example:
    add_library(
        file1.cc
    )
    Here, file1.cc becomes #file1.cc with disable_file('file1.cc').
    """
    starts_line = False
    for line in self.cfile.splitlines():
        if len(line.strip()) == 0 or line.strip()[0] == '#':
            continue
        if re.search(r'\b' + fname + r'\b', line):
            if re.match(fname, line.lstrip()):
                starts_line = True
            break
    comment_out_re = r'#\1' + '\n' + self.indent
    if not starts_line:
        comment_out_re = r'\n' + self.indent + comment_out_re
    (self.cfile, nsubs) = re.subn(
        r'(\b' + fname + r'\b)\s*', comment_out_re, self.cfile)
    if nsubs == 0:
        logger.warning(
            "Warning: A replacement failed when commenting out {}. Check the CMakeFile.txt manually.".format(fname))
    elif nsubs > 1:
        logger.warning(
            "Warning: Replaced {} {} times (instead of once). Check the CMakeFile.txt manually.".format(fname, nsubs))