diff --git a/deluge/plugins/Blocklist/deluge/__init__.py b/deluge/plugins/Blocklist/deluge/__init__.py new file mode 100644 index 000000000..94033e829 --- /dev/null +++ b/deluge/plugins/Blocklist/deluge/__init__.py @@ -0,0 +1,3 @@ +# this is a namespace package +import pkg_resources +pkg_resources.declare_namespace(__name__) diff --git a/deluge/plugins/Blocklist/deluge/plugins/__init__.py b/deluge/plugins/Blocklist/deluge/plugins/__init__.py new file mode 100644 index 000000000..94033e829 --- /dev/null +++ b/deluge/plugins/Blocklist/deluge/plugins/__init__.py @@ -0,0 +1,3 @@ +# this is a namespace package +import pkg_resources +pkg_resources.declare_namespace(__name__) diff --git a/deluge/plugins/blocklist/blocklist/__init__.py b/deluge/plugins/Blocklist/deluge/plugins/blocklist/__init__.py similarity index 100% rename from deluge/plugins/blocklist/blocklist/__init__.py rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/__init__.py diff --git a/deluge/plugins/blocklist/blocklist/common.py b/deluge/plugins/Blocklist/deluge/plugins/blocklist/common.py similarity index 94% rename from deluge/plugins/blocklist/blocklist/common.py rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/common.py index c2076acae..147f77d5e 100644 --- a/deluge/plugins/blocklist/blocklist/common.py +++ b/deluge/plugins/Blocklist/deluge/plugins/blocklist/common.py @@ -40,7 +40,8 @@ from functools import wraps from sys import exc_info def get_resource(filename): - return pkg_resources.resource_filename("blocklist", os.path.join("data", filename)) + return pkg_resources.resource_filename("deluge.plugins.blocklist", + os.path.join("data", filename)) def raisesErrorsAs(error): """ @@ -73,14 +74,14 @@ def raisesErrorsAs(error): def remove_zeros(ip): """ Removes unneeded zeros from ip addresses. - + Example: 000.000.000.003 -> 0.0.0.3 - + :param ip: the ip address :type ip: string - + :returns: the ip address without the unneeded zeros :rtype: string - + """ return ".".join([part.lstrip("0").zfill(1) for part in ip.split(".")]) diff --git a/deluge/plugins/blocklist/blocklist/core.py b/deluge/plugins/Blocklist/deluge/plugins/blocklist/core.py similarity index 100% rename from deluge/plugins/blocklist/blocklist/core.py rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/core.py diff --git a/deluge/plugins/blocklist/blocklist/data/COPYING b/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/COPYING similarity index 100% rename from deluge/plugins/blocklist/blocklist/data/COPYING rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/data/COPYING diff --git a/deluge/plugins/blocklist/blocklist/data/LICENSE b/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/LICENSE similarity index 100% rename from deluge/plugins/blocklist/blocklist/data/LICENSE rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/data/LICENSE diff --git a/deluge/plugins/blocklist/blocklist/data/blocklist16.png b/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist16.png similarity index 100% rename from deluge/plugins/blocklist/blocklist/data/blocklist16.png rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist16.png diff --git a/deluge/plugins/blocklist/blocklist/data/blocklist_download24.png b/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_download24.png similarity index 100% rename from deluge/plugins/blocklist/blocklist/data/blocklist_download24.png rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_download24.png diff --git a/deluge/plugins/blocklist/blocklist/data/blocklist_import24.png b/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_import24.png similarity index 100% rename from deluge/plugins/blocklist/blocklist/data/blocklist_import24.png rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_import24.png diff --git a/deluge/plugins/blocklist/blocklist/data/blocklist_pref.glade b/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_pref.glade similarity index 100% rename from deluge/plugins/blocklist/blocklist/data/blocklist_pref.glade rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_pref.glade diff --git a/deluge/plugins/blocklist/blocklist/decompressers.py b/deluge/plugins/Blocklist/deluge/plugins/blocklist/decompressers.py similarity index 100% rename from deluge/plugins/blocklist/blocklist/decompressers.py rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/decompressers.py diff --git a/deluge/plugins/blocklist/blocklist/detect.py b/deluge/plugins/Blocklist/deluge/plugins/blocklist/detect.py similarity index 100% rename from deluge/plugins/blocklist/blocklist/detect.py rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/detect.py diff --git a/deluge/plugins/blocklist/blocklist/gtkui.py b/deluge/plugins/Blocklist/deluge/plugins/blocklist/gtkui.py similarity index 100% rename from deluge/plugins/blocklist/blocklist/gtkui.py rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/gtkui.py diff --git a/deluge/plugins/blocklist/blocklist/peerguardian.py b/deluge/plugins/Blocklist/deluge/plugins/blocklist/peerguardian.py similarity index 100% rename from deluge/plugins/blocklist/blocklist/peerguardian.py rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/peerguardian.py diff --git a/deluge/plugins/blocklist/blocklist/readers.py b/deluge/plugins/Blocklist/deluge/plugins/blocklist/readers.py similarity index 100% rename from deluge/plugins/blocklist/blocklist/readers.py rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/readers.py diff --git a/deluge/plugins/blocklist/blocklist/webui.py b/deluge/plugins/Blocklist/deluge/plugins/blocklist/webui.py similarity index 100% rename from deluge/plugins/blocklist/blocklist/webui.py rename to deluge/plugins/Blocklist/deluge/plugins/blocklist/webui.py diff --git a/deluge/plugins/blocklist/setup.py b/deluge/plugins/Blocklist/setup.py similarity index 87% rename from deluge/plugins/blocklist/setup.py rename to deluge/plugins/Blocklist/setup.py index f690278a6..ee44297f4 100644 --- a/deluge/plugins/blocklist/setup.py +++ b/deluge/plugins/Blocklist/setup.py @@ -31,7 +31,7 @@ # -from setuptools import setup +from setuptools import setup, find_packages __plugin_name__ = "Blocklist" __author__ = "John Garland" @@ -41,7 +41,7 @@ __url__ = "http://deluge-torrent.org" __license__ = "GPLv3" __description__ = "Download and import IP blocklists" __long_description__ = __description__ -__pkg_data__ = {__plugin_name__.lower(): ["data/*"]} +__pkg_data__ = {'deluge.plugins.'+__plugin_name__.lower(): ["data/*"]} setup( name=__plugin_name__, @@ -53,15 +53,16 @@ setup( license=__license__, long_description=__long_description__, - packages=[__plugin_name__.lower()], + packages=find_packages(), + namespace_packages = ["deluge", "deluge.plugins"], package_data = __pkg_data__, entry_points=""" [deluge.plugin.core] - %s = %s:CorePlugin + %s = deluge.plugins.%s:CorePlugin [deluge.plugin.gtkui] - %s = %s:GtkUIPlugin + %s = deluge.plugins.%s:GtkUIPlugin [deluge.plugin.webui] - %s = %s:WebUIPlugin + %s = deluge.plugins.%s:WebUIPlugin """ % ((__plugin_name__, __plugin_name__.lower())*3) ) diff --git a/deluge/plugins/Example/deluge/__init__.py b/deluge/plugins/Example/deluge/__init__.py new file mode 100644 index 000000000..94033e829 --- /dev/null +++ b/deluge/plugins/Example/deluge/__init__.py @@ -0,0 +1,3 @@ +# this is a namespace package +import pkg_resources +pkg_resources.declare_namespace(__name__) diff --git a/deluge/plugins/Example/deluge/plugins/__init__.py b/deluge/plugins/Example/deluge/plugins/__init__.py new file mode 100644 index 000000000..94033e829 --- /dev/null +++ b/deluge/plugins/Example/deluge/plugins/__init__.py @@ -0,0 +1,3 @@ +# this is a namespace package +import pkg_resources +pkg_resources.declare_namespace(__name__) diff --git a/deluge/plugins/example/example/__init__.py b/deluge/plugins/Example/deluge/plugins/example/__init__.py similarity index 100% rename from deluge/plugins/example/example/__init__.py rename to deluge/plugins/Example/deluge/plugins/example/__init__.py diff --git a/deluge/plugins/execute/execute/common.py b/deluge/plugins/Example/deluge/plugins/example/common.py similarity index 91% rename from deluge/plugins/execute/execute/common.py rename to deluge/plugins/Example/deluge/plugins/example/common.py index b3e3ad59c..72e3750c6 100644 --- a/deluge/plugins/execute/execute/common.py +++ b/deluge/plugins/Example/deluge/plugins/example/common.py @@ -37,4 +37,5 @@ import pkg_resources import os.path def get_resource(filename): - return pkg_resources.resource_filename("execute", os.path.join("data", filename)) + return pkg_resources.resource_filename("deluge.plugins.example", + os.path.join("data", filename)) diff --git a/deluge/plugins/example/example/core.py b/deluge/plugins/Example/deluge/plugins/example/core.py similarity index 100% rename from deluge/plugins/example/example/core.py rename to deluge/plugins/Example/deluge/plugins/example/core.py diff --git a/deluge/plugins/example/example/data/example.js b/deluge/plugins/Example/deluge/plugins/example/data/example.js similarity index 100% rename from deluge/plugins/example/example/data/example.js rename to deluge/plugins/Example/deluge/plugins/example/data/example.js diff --git a/deluge/plugins/example/example/gtkui.py b/deluge/plugins/Example/deluge/plugins/example/gtkui.py similarity index 100% rename from deluge/plugins/example/example/gtkui.py rename to deluge/plugins/Example/deluge/plugins/example/gtkui.py diff --git a/deluge/plugins/example/example/webui.py b/deluge/plugins/Example/deluge/plugins/example/webui.py similarity index 100% rename from deluge/plugins/example/example/webui.py rename to deluge/plugins/Example/deluge/plugins/example/webui.py diff --git a/deluge/plugins/example/setup.py b/deluge/plugins/Example/setup.py similarity index 87% rename from deluge/plugins/example/setup.py rename to deluge/plugins/Example/setup.py index c666efc18..59f8582fa 100644 --- a/deluge/plugins/example/setup.py +++ b/deluge/plugins/Example/setup.py @@ -31,7 +31,7 @@ # # -from setuptools import setup +from setuptools import setup, find_packages __plugin_name__ = "Example" __author__ = "Andrew Resch" @@ -41,7 +41,7 @@ __url__ = "http://deluge-torrent.org" __license__ = "GPLv3" __description__ = "Example plugin" __long_description__ = __description__ -__pkg_data__ = {__plugin_name__.lower(): []} +__pkg_data__ = {"deluge.plugins."+__plugin_name__.lower(): []} setup( name=__plugin_name__, @@ -53,15 +53,16 @@ setup( license=__license__, long_description=__long_description__, - packages=[__plugin_name__.lower()], + packages=find_packages(), + namespace_packages = ["deluge", "deluge.plugins"], package_data = __pkg_data__, entry_points=""" [deluge.plugin.core] - %s = %s:CorePlugin + %s = %s:deluge.plugins.CorePlugin [deluge.plugin.gtkui] - %s = %s:GtkUIPlugin + %s = %s:deluge.plugins.GtkUIPlugin [deluge.plugin.webui] - %s = %s:WebUIPlugin + %s = %s:deluge.plugins.WebUIPlugin """ % ((__plugin_name__, __plugin_name__.lower())*3) ) diff --git a/deluge/plugins/Execute/deluge/__init__.py b/deluge/plugins/Execute/deluge/__init__.py new file mode 100644 index 000000000..94033e829 --- /dev/null +++ b/deluge/plugins/Execute/deluge/__init__.py @@ -0,0 +1,3 @@ +# this is a namespace package +import pkg_resources +pkg_resources.declare_namespace(__name__) diff --git a/deluge/plugins/Execute/deluge/plugins/__init__.py b/deluge/plugins/Execute/deluge/plugins/__init__.py new file mode 100644 index 000000000..94033e829 --- /dev/null +++ b/deluge/plugins/Execute/deluge/plugins/__init__.py @@ -0,0 +1,3 @@ +# this is a namespace package +import pkg_resources +pkg_resources.declare_namespace(__name__) diff --git a/deluge/plugins/execute/execute/__init__.py b/deluge/plugins/Execute/deluge/plugins/execute/__init__.py similarity index 100% rename from deluge/plugins/execute/execute/__init__.py rename to deluge/plugins/Execute/deluge/plugins/execute/__init__.py diff --git a/deluge/plugins/example/example/common.py b/deluge/plugins/Execute/deluge/plugins/execute/common.py similarity index 91% rename from deluge/plugins/example/example/common.py rename to deluge/plugins/Execute/deluge/plugins/execute/common.py index 71701676d..d0d33799c 100644 --- a/deluge/plugins/example/example/common.py +++ b/deluge/plugins/Execute/deluge/plugins/execute/common.py @@ -37,4 +37,5 @@ import pkg_resources import os.path def get_resource(filename): - return pkg_resources.resource_filename("example", os.path.join("data", filename)) + return pkg_resources.resource_filename("deluge.plugins.execute", + os.path.join("data", filename)) diff --git a/deluge/plugins/execute/execute/core.py b/deluge/plugins/Execute/deluge/plugins/execute/core.py similarity index 100% rename from deluge/plugins/execute/execute/core.py rename to deluge/plugins/Execute/deluge/plugins/execute/core.py diff --git a/deluge/plugins/execute/execute/data/execute.js b/deluge/plugins/Execute/deluge/plugins/execute/data/execute.js similarity index 100% rename from deluge/plugins/execute/execute/data/execute.js rename to deluge/plugins/Execute/deluge/plugins/execute/data/execute.js diff --git a/deluge/plugins/execute/execute/data/execute_prefs.glade b/deluge/plugins/Execute/deluge/plugins/execute/data/execute_prefs.glade similarity index 100% rename from deluge/plugins/execute/execute/data/execute_prefs.glade rename to deluge/plugins/Execute/deluge/plugins/execute/data/execute_prefs.glade diff --git a/deluge/plugins/execute/execute/gtkui.py b/deluge/plugins/Execute/deluge/plugins/execute/gtkui.py similarity index 100% rename from deluge/plugins/execute/execute/gtkui.py rename to deluge/plugins/Execute/deluge/plugins/execute/gtkui.py diff --git a/deluge/plugins/execute/execute/webui.py b/deluge/plugins/Execute/deluge/plugins/execute/webui.py similarity index 98% rename from deluge/plugins/execute/execute/webui.py rename to deluge/plugins/Execute/deluge/plugins/execute/webui.py index 991219b04..7bdb6d198 100644 --- a/deluge/plugins/execute/execute/webui.py +++ b/deluge/plugins/Execute/deluge/plugins/execute/webui.py @@ -33,7 +33,6 @@ # # -import pkg_resources from deluge.log import LOG as log from deluge.ui.client import client @@ -43,6 +42,6 @@ from deluge.plugins.pluginbase import WebPluginBase from common import get_resource class WebUI(WebPluginBase): - + scripts = [get_resource("execute.js")] debug_scripts = scripts diff --git a/deluge/plugins/execute/setup.py b/deluge/plugins/Execute/setup.py similarity index 87% rename from deluge/plugins/execute/setup.py rename to deluge/plugins/Execute/setup.py index 2938e1757..ab93b6b4b 100644 --- a/deluge/plugins/execute/setup.py +++ b/deluge/plugins/Execute/setup.py @@ -31,7 +31,7 @@ # # -from setuptools import setup +from setuptools import setup, find_packages __plugin_name__ = "Execute" __author__ = "Damien Churchill" @@ -41,7 +41,7 @@ __url__ = "http://deluge-torrent.org" __license__ = "GPLv3" __description__ = "Plugin to execute a command upon an event" __long_description__ = __description__ -__pkg_data__ = {__plugin_name__.lower(): ["data/*"]} +__pkg_data__ = {"deluge.plugins."+__plugin_name__.lower(): ["data/*"]} setup( name=__plugin_name__, @@ -53,15 +53,16 @@ setup( license=__license__, long_description=__long_description__, - packages=[__plugin_name__.lower()], + packages=find_packages(), + namespace_packages = ["deluge", "deluge.plugins"], package_data = __pkg_data__, entry_points=""" [deluge.plugin.core] - %s = %s:CorePlugin + %s = %s:deluge.plugins.CorePlugin [deluge.plugin.gtkui] - %s = %s:GtkUIPlugin + %s = %s:deluge.plugins.GtkUIPlugin [deluge.plugin.web] - %s = %s:WebUIPlugin + %s = %s:deluge.plugins.WebUIPlugin """ % ((__plugin_name__, __plugin_name__.lower())*3) )