From f9d30b70711b4f36c917a654d13afe4d37a066d1 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 23 Nov 2008 05:57:35 +0000 Subject: [PATCH] Create a 'build_plugins' command and clean-up setup.py --- setup.py | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index da8d84696..0c7658f42 100644 --- a/setup.py +++ b/setup.py @@ -216,8 +216,27 @@ class build_trans(cmd.Command): print('Compiling %s' % src) msgfmt.make(src, dest) +class build_plugins(cmd.Command): + description = "Build plugins into .eggs" + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + # Build the plugin eggs + PLUGIN_PATH = "deluge/plugins/*" + if windows_check(): + PLUGIN_PATH = "deluge\\plugins\\" + + for path in glob.glob(PLUGIN_PATH): + if os.path.exists(os.path.join(path, "setup.py")): + os.system("cd " + path + "&& python setup.py bdist_egg -d ..") + class build(_build): - sub_commands = _build.sub_commands + [('build_trans', None)] + sub_commands = _build.sub_commands + [('build_trans', None), ('build_plugins', None)] def run(self): _build.run(self) @@ -228,18 +247,10 @@ class install_data(_install_data): cmdclass = { 'build': build, 'build_trans': build_trans, + 'build_plugins': build_plugins, 'install_data': install_data } -# Build the plugin eggs -PLUGIN_PATH = "deluge/plugins/*" -if windows_check(): - PLUGIN_PATH = "deluge\\plugins\\" - -for path in glob.glob(PLUGIN_PATH): - if os.path.exists(os.path.join(path, "setup.py")): - os.system("cd " + path + "&& python setup.py bdist_egg -d ..") - # Main setup PREFIX = "/usr/" if windows_check():