def add_ignore(self):
path = self.lazy_folder + self.ignore_filename<EOL>if os.path.isfile(os.path.realpath(path)):<EOL><INDENT>return None<EOL><DEDENT>sp, sf = os.path.split(self.data_file)<EOL>try:<EOL><INDENT>handle = open(path,'<STR_LIT:w>')<EOL>handle.write(sf + '<STR_LIT:\n>')<EOL><DEDENT>except IOError as e:<EOL><INDENT>raise e<EOL><DEDENT>handle.close()<EOL>return None<EOL>
Writes a .gitignore file to ignore the generated data file.