1. Tom Burdick
  2. cutehg

Commits

Jan Borsodi  committed ac960e7

Turned ui builder into a proper distutils Command and replaced the default 'build' command to include 'build_ui' and 'build_winext'.
Also made sure that 'build_ui' is run before any standard build commands (like 'build_py').

  • Participants
  • Parent commits 2a0cacf
  • Branches default

Comments (0)

Files changed (1)

File setup.py

View file
         buildWinShellExt()
         build_ext.run(self)
 
-class CuteHgBuild(build):
+class CuteHgBuildUi(Command):
+    description = "build Python modules from Qt Designer .ui files"
+
+    user_options = []
+
+    def initialize_options(self):
+        pass
+
+    def finalize_options(self):
+        pass
+
     def compile_ui(self, ui_file, py_file):
         if not needsupdate(ui_file, py_file):
             return
         copy_file( 'cutehg/icons_rc.py', 'cutehg/dialogs/icons_rc.py' )
         copy_file( 'cutehg/icons_rc.py', 'cutehg/views/icons_rc.py' )
 
-        build.run(self)
-
-    def is_win_platform(self):
-        return hasattr(self, "plat_name") and (self.plat_name[:3] == 'win')
-
-    sub_commands = build.sub_commands + [('build_winext', is_win_platform)]
-
 def hg(command, *args, **kwargs):
     """
     gopts: Global options, set before the command
             self.install_script = 'postinstall.py'
     return bdist_win
 
-build.sub_commands += [('build_ui', None)]
+class CuteHgBuild(build):
+    def is_win_platform(self):
+        return hasattr(self, "plat_name") and (self.plat_name[:3] == 'win')
+
+    sub_commands = [('build_ui', None)] + build.sub_commands + [('build_winext', is_win_platform)]
+
 cmds = {
-        'build_ui' : CuteHgBuild,
+        'build' : CuteHgBuild,
+        'build_ui' : CuteHgBuildUi,
         'build_winext' : build_winext,
         'py2exe' : CuteHgPy2Exe,
        }