From 7bccce4e9cead619a8686c19a04c240c73763b8a Mon Sep 17 00:00:00 2001 From: Nate Hardison Date: Tue, 4 Jun 2013 11:02:55 -0700 Subject: [PATCH] Add comment to dynamically-generated asset files To avoid confusion about where these files come from, add a header comment upon preprocessing that warns people to not modify the generated files directly, and points them to the appropriate template file. --- .../mitxmako/management/commands/preprocess_assets.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/djangoapps/mitxmako/management/commands/preprocess_assets.py b/common/djangoapps/mitxmako/management/commands/preprocess_assets.py index 36a2da9ad3..6afcbe896e 100644 --- a/common/djangoapps/mitxmako/management/commands/preprocess_assets.py +++ b/common/djangoapps/mitxmako/management/commands/preprocess_assets.py @@ -14,6 +14,7 @@ from django.core.management.base import NoArgsCommand from django.conf import settings from mako.template import Template +import textwrap class Command(NoArgsCommand): """ @@ -61,5 +62,12 @@ class Command(NoArgsCommand): result in `outfile`. """ with open(outfile, "w") as _outfile: + _outfile.write(textwrap.dedent("""\ + /* + * This file is dynamically generated and ignored by Git. + * DO NOT MAKE CHANGES HERE. Instead, go edit its template: + * %s + */ + """ % infile)) _outfile.write(Template(filename=str(infile)).render(env=self.__context()))