# HG changeset patch # User Simon Heimberg # Date 1320174833 -3600 # Node ID f9f0731dbc560bc1814148994a93016499b4471c # Parent 434c48e981b866ed4988d087d0c0b16b84a25201 setup: subclass build command diff -r 434c48e981b8 -r f9f0731dbc56 setup.py --- a/setup.py Tue Nov 01 20:13:52 2011 +0100 +++ b/setup.py Tue Nov 01 20:13:53 2011 +0100 @@ -186,6 +186,12 @@ except ImportError: version = 'unknown' +class hgbuild(build): + # Insert hgbuildmo first so that files in mercurial/locale/ are found + # when build_py is run next. + sub_commands = [('build_mo', None), + ] + build.sub_commands + class hgbuildmo(build): description = "build translations (.mo files)" @@ -217,10 +223,6 @@ self.make_file([pofile], mobuildfile, spawn, (cmd,)) -# Insert hgbuildmo first so that files in mercurial/locale/ are found -# when build_py is run next. -build.sub_commands.insert(0, ('build_mo', None)) - class hgdist(Distribution): pure = 0 @@ -344,7 +346,8 @@ fp.write(data) fp.close() -cmdclass = {'build_mo': hgbuildmo, +cmdclass = {'build': hgbuild, + 'build_mo': hgbuildmo, 'build_ext': hgbuildext, 'build_py': hgbuildpy, 'build_hgextindex': buildhgextindex,