changeset 15460:f9f0731dbc56

setup: subclass build command
author Simon Heimberg <simohe@besonet.ch>
date Tue, 01 Nov 2011 20:13:53 +0100
parents 434c48e981b8
children 99824055d323
files setup.py
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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,