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.
This commit is contained in:
parent
4aab110aaf
commit
15e9f5f218
54
setup.py
54
setup.py
|
@ -293,6 +293,46 @@ class build_plugins(cmd.Command):
|
||||||
os.system("cd " + path + "&& " + sys.executable + " setup.py bdist_egg -d ..")
|
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):
|
class build_docs(BuildDoc):
|
||||||
def run(self):
|
def run(self):
|
||||||
class FakeModule(object):
|
class FakeModule(object):
|
||||||
|
@ -363,7 +403,7 @@ class clean_plugins(cmd.Command):
|
||||||
self.set_undefined_options('clean', ('all', 'all'))
|
self.set_undefined_options('clean', ('all', 'all'))
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
print("Cleaning the plugin folders..")
|
print("Cleaning the plugin's folders..")
|
||||||
|
|
||||||
PLUGIN_PATH = "deluge/plugins/*"
|
PLUGIN_PATH = "deluge/plugins/*"
|
||||||
|
|
||||||
|
@ -379,6 +419,16 @@ class clean_plugins(cmd.Command):
|
||||||
print("Deleting %s" % path)
|
print("Deleting %s" % path)
|
||||||
os.remove(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):
|
class clean(_clean):
|
||||||
sub_commands = _clean.sub_commands + [('clean_plugins', None)]
|
sub_commands = _clean.sub_commands + [('clean_plugins', None)]
|
||||||
|
|
||||||
|
@ -397,6 +447,8 @@ cmdclass = {
|
||||||
'build_ext_debug': build_ext_debug,
|
'build_ext_debug': build_ext_debug,
|
||||||
'clean_plugins': clean_plugins,
|
'clean_plugins': clean_plugins,
|
||||||
'clean': clean,
|
'clean': clean,
|
||||||
|
'develop_plugins': develop_plugins,
|
||||||
|
'egg_info_plugins': egg_info_plugins
|
||||||
}
|
}
|
||||||
|
|
||||||
# Data files to be installed to the system
|
# Data files to be installed to the system
|
||||||
|
|
Loading…
Reference in New Issue