diff options
author | Pedro Algarvio <pedro@algarvio.me> | 2011-06-05 16:58:27 +0100 |
---|---|---|
committer | Pedro Algarvio <pedro@algarvio.me> | 2011-06-05 16:58:27 +0100 |
commit | 15e9f5f2181db0e7b31ba7310a73d7ea612239d0 (patch) | |
tree | 4fe5178d372c865fba49ff319f102f1fae2f35d1 /setup.py | |
parent | 4aab110aaff3f292d762afb74fde4bcef99ee2e9 (diff) | |
download | deluge-15e9f5f2181db0e7b31ba7310a73d7ea612239d0.tar.gz deluge-15e9f5f2181db0e7b31ba7310a73d7ea612239d0.tar.bz2 deluge-15e9f5f2181db0e7b31ba7310a73d7ea612239d0.zip |
Add 2 more commands to setup.py
Two more commands were added to setup.py:
* develop_plugins - Installs each of the plugins in development mode
* egg_info_plugins - Create the '.egg-info' distribution directories for each plugin. This will make the plugin discoverable by deluge
Both these commands are intended to be used while developing deluge.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 54 |
1 files changed, 53 insertions, 1 deletions
@@ -293,6 +293,46 @@ class build_plugins(cmd.Command): os.system("cd " + path + "&& " + sys.executable + " setup.py bdist_egg -d ..") +class develop_plugins(cmd.Command): + description = "install plugin's in 'development mode'" + + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + # Build the plugin eggs + 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 + "&& " + sys.executable + " setup.py develop") + + +class egg_info_plugins(cmd.Command): + description = "create a distribution's .egg-info directory" + + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + # Build the plugin eggs + 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 + "&& " + sys.executable + " setup.py egg_info") + + class build_docs(BuildDoc): def run(self): class FakeModule(object): @@ -363,7 +403,7 @@ class clean_plugins(cmd.Command): self.set_undefined_options('clean', ('all', 'all')) def run(self): - print("Cleaning the plugin folders..") + print("Cleaning the plugin's folders..") PLUGIN_PATH = "deluge/plugins/*" @@ -379,6 +419,16 @@ class clean_plugins(cmd.Command): print("Deleting %s" % path) os.remove(path) + EGG_INFO_DIR_PATH = "deluge/plugins/*/*.egg-info" + + for path in glob.glob(EGG_INFO_DIR_PATH): + # Delete the .egg-info's directories + if path[-9:] == ".egg-info": + print("Deleting %s" % path) + for fpath in os.listdir(path): + os.remove(os.path.join(path, fpath)) + os.removedirs(path) + class clean(_clean): sub_commands = _clean.sub_commands + [('clean_plugins', None)] @@ -397,6 +447,8 @@ cmdclass = { 'build_ext_debug': build_ext_debug, 'clean_plugins': clean_plugins, 'clean': clean, + 'develop_plugins': develop_plugins, + 'egg_info_plugins': egg_info_plugins } # Data files to be installed to the system |