From d3d418de540bb4d901b374c39e2d157459a336c7 Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Mon, 31 Mar 2014 15:13:19 +0200 Subject: [PATCH] Drop time-stamp comparison, remove variable comments from generated files. See discussion at http://tickets.musicbrainz.org/browse/PICARD-566 --- setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b50438aa9..036020a79 100755 --- a/setup.py +++ b/setup.py @@ -311,8 +311,13 @@ class picard_build_ui(Command): tmp = StringIO() uic.compileUi(uifile, tmp) source = tmp.getvalue() + rc = re.compile(r'\n\n#.*?(?=\n\n)', re.MULTILINE|re.DOTALL) + comment = (u"\n\n# Automatically generated - don't edit.\n" + u"# Use `python setup.py %s` to update it." + % _get_option_name(self)) for r in list(_translate_re): source = r.sub(r'_(\1)', source) + source = rc.sub(comment, source) f = open(pyfile, "w") f.write(source) f.close() @@ -322,8 +327,7 @@ class picard_build_ui(Command): compile_ui(uifile, pyfile) else: for uifile, pyfile in ui_files(): - if newer(uifile, pyfile): - compile_ui(uifile, pyfile) + compile_ui(uifile, pyfile) from resources import compile, makeqrc makeqrc.main()