diff --git a/deluge/__init__.py b/deluge/__init__.py index 3a58602bd..1836ded86 100644 --- a/deluge/__init__.py +++ b/deluge/__init__.py @@ -1,2 +1 @@ """Deluge""" -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/AutoAdd/deluge/__init__.py b/deluge/plugins/AutoAdd/deluge/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/AutoAdd/deluge/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/AutoAdd/deluge/plugins/__init__.py b/deluge/plugins/AutoAdd/deluge/plugins/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/AutoAdd/deluge/plugins/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/__init__.py b/deluge/plugins/AutoAdd/deluge_autoadd/__init__.py similarity index 100% rename from deluge/plugins/AutoAdd/deluge/plugins/autoadd/__init__.py rename to deluge/plugins/AutoAdd/deluge_autoadd/__init__.py diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/common.py b/deluge/plugins/AutoAdd/deluge_autoadd/common.py similarity index 90% rename from deluge/plugins/AutoAdd/deluge/plugins/autoadd/common.py rename to deluge/plugins/AutoAdd/deluge_autoadd/common.py index 16b41e643..9b4b1e703 100644 --- a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/common.py +++ b/deluge/plugins/AutoAdd/deluge_autoadd/common.py @@ -21,4 +21,4 @@ from pkg_resources import resource_filename def get_resource(filename, subdir=False): folder = os.path.join('data', 'autoadd_options') if subdir else 'data' - return resource_filename('deluge.plugins.autoadd', os.path.join(folder, filename)) + return resource_filename(__package__, os.path.join(folder, filename)) diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py b/deluge/plugins/AutoAdd/deluge_autoadd/core.py similarity index 100% rename from deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py rename to deluge/plugins/AutoAdd/deluge_autoadd/core.py diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd.js b/deluge/plugins/AutoAdd/deluge_autoadd/data/autoadd.js similarity index 100% rename from deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd.js rename to deluge/plugins/AutoAdd/deluge_autoadd/data/autoadd.js diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options.js b/deluge/plugins/AutoAdd/deluge_autoadd/data/autoadd_options.js similarity index 100% rename from deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options.js rename to deluge/plugins/AutoAdd/deluge_autoadd/data/autoadd_options.js diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options.ui b/deluge/plugins/AutoAdd/deluge_autoadd/data/autoadd_options.ui similarity index 100% rename from deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options.ui rename to deluge/plugins/AutoAdd/deluge_autoadd/data/autoadd_options.ui diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options/main_tab.js b/deluge/plugins/AutoAdd/deluge_autoadd/data/autoadd_options/main_tab.js similarity index 100% rename from deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options/main_tab.js rename to deluge/plugins/AutoAdd/deluge_autoadd/data/autoadd_options/main_tab.js diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options/options_tab.js b/deluge/plugins/AutoAdd/deluge_autoadd/data/autoadd_options/options_tab.js similarity index 100% rename from deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options/options_tab.js rename to deluge/plugins/AutoAdd/deluge_autoadd/data/autoadd_options/options_tab.js diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/config.ui b/deluge/plugins/AutoAdd/deluge_autoadd/data/config.ui similarity index 100% rename from deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/config.ui rename to deluge/plugins/AutoAdd/deluge_autoadd/data/config.ui diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py b/deluge/plugins/AutoAdd/deluge_autoadd/gtkui.py similarity index 100% rename from deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py rename to deluge/plugins/AutoAdd/deluge_autoadd/gtkui.py diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/webui.py b/deluge/plugins/AutoAdd/deluge_autoadd/webui.py similarity index 100% rename from deluge/plugins/AutoAdd/deluge/plugins/autoadd/webui.py rename to deluge/plugins/AutoAdd/deluge_autoadd/webui.py diff --git a/deluge/plugins/AutoAdd/setup.py b/deluge/plugins/AutoAdd/setup.py index 2fe68efb6..fcd018395 100644 --- a/deluge/plugins/AutoAdd/setup.py +++ b/deluge/plugins/AutoAdd/setup.py @@ -23,9 +23,7 @@ __url__ = 'http://dev.deluge-torrent.org/wiki/Plugins/AutoAdd' __license__ = 'GPLv3' __description__ = 'Monitors folders for .torrent files.' __long_description__ = """""" -__pkg_data__ = { - 'deluge.plugins.' + __plugin_name__.lower(): ['template/*', 'data/*', 'data/*/*'] -} +__pkg_data__ = {'deluge_' + __plugin_name__.lower(): ['data/*', 'data/*/*']} setup( name=__plugin_name__, @@ -37,15 +35,14 @@ setup( license=__license__, long_description=__long_description__ if __long_description__ else __description__, packages=find_packages(), - namespace_packages=['deluge', 'deluge.plugins'], package_data=__pkg_data__, entry_points=""" [deluge.plugin.core] - %s = deluge.plugins.%s:CorePlugin + %s = deluge_%s:CorePlugin [deluge.plugin.gtk3ui] - %s = deluge.plugins.%s:Gtk3UIPlugin + %s = deluge_%s:Gtk3UIPlugin [deluge.plugin.web] - %s = deluge.plugins.%s:WebUIPlugin + %s = deluge_%s:WebUIPlugin """ % ((__plugin_name__, __plugin_name__.lower()) * 3), ) diff --git a/deluge/plugins/Blocklist/deluge/__init__.py b/deluge/plugins/Blocklist/deluge/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Blocklist/deluge/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Blocklist/deluge/plugins/__init__.py b/deluge/plugins/Blocklist/deluge/plugins/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Blocklist/deluge/plugins/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/__init__.py b/deluge/plugins/Blocklist/deluge_blocklist/__init__.py similarity index 100% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/__init__.py rename to deluge/plugins/Blocklist/deluge_blocklist/__init__.py diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/common.py b/deluge/plugins/Blocklist/deluge_blocklist/common.py similarity index 98% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/common.py rename to deluge/plugins/Blocklist/deluge_blocklist/common.py index d42d90d2f..a9299cd2e 100644 --- a/deluge/plugins/Blocklist/deluge/plugins/blocklist/common.py +++ b/deluge/plugins/Blocklist/deluge_blocklist/common.py @@ -23,7 +23,7 @@ from pkg_resources import resource_filename def get_resource(filename): - return resource_filename('deluge.plugins.blocklist', os.path.join('data', filename)) + return resource_filename(__package__, os.path.join('data', filename)) def raises_errors_as(error): diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/core.py b/deluge/plugins/Blocklist/deluge_blocklist/core.py similarity index 100% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/core.py rename to deluge/plugins/Blocklist/deluge_blocklist/core.py diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist.js b/deluge/plugins/Blocklist/deluge_blocklist/data/blocklist.js similarity index 100% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist.js rename to deluge/plugins/Blocklist/deluge_blocklist/data/blocklist.js diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist16.png b/deluge/plugins/Blocklist/deluge_blocklist/data/blocklist16.png similarity index 100% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist16.png rename to deluge/plugins/Blocklist/deluge_blocklist/data/blocklist16.png diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_download24.png b/deluge/plugins/Blocklist/deluge_blocklist/data/blocklist_download24.png similarity index 100% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_download24.png rename to deluge/plugins/Blocklist/deluge_blocklist/data/blocklist_download24.png diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_import24.png b/deluge/plugins/Blocklist/deluge_blocklist/data/blocklist_import24.png similarity index 100% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_import24.png rename to deluge/plugins/Blocklist/deluge_blocklist/data/blocklist_import24.png diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_pref.ui b/deluge/plugins/Blocklist/deluge_blocklist/data/blocklist_pref.ui similarity index 100% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_pref.ui rename to deluge/plugins/Blocklist/deluge_blocklist/data/blocklist_pref.ui diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/decompressers.py b/deluge/plugins/Blocklist/deluge_blocklist/decompressers.py similarity index 100% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/decompressers.py rename to deluge/plugins/Blocklist/deluge_blocklist/decompressers.py diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/detect.py b/deluge/plugins/Blocklist/deluge_blocklist/detect.py similarity index 100% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/detect.py rename to deluge/plugins/Blocklist/deluge_blocklist/detect.py diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/gtkui.py b/deluge/plugins/Blocklist/deluge_blocklist/gtkui.py similarity index 100% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/gtkui.py rename to deluge/plugins/Blocklist/deluge_blocklist/gtkui.py diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/peerguardian.py b/deluge/plugins/Blocklist/deluge_blocklist/peerguardian.py similarity index 100% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/peerguardian.py rename to deluge/plugins/Blocklist/deluge_blocklist/peerguardian.py diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/readers.py b/deluge/plugins/Blocklist/deluge_blocklist/readers.py similarity index 100% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/readers.py rename to deluge/plugins/Blocklist/deluge_blocklist/readers.py diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/webui.py b/deluge/plugins/Blocklist/deluge_blocklist/webui.py similarity index 100% rename from deluge/plugins/Blocklist/deluge/plugins/blocklist/webui.py rename to deluge/plugins/Blocklist/deluge_blocklist/webui.py diff --git a/deluge/plugins/Blocklist/setup.py b/deluge/plugins/Blocklist/setup.py index 1d21847d8..54ad002a3 100644 --- a/deluge/plugins/Blocklist/setup.py +++ b/deluge/plugins/Blocklist/setup.py @@ -17,7 +17,7 @@ __url__ = 'http://deluge-torrent.org' __license__ = 'GPLv3' __description__ = 'Download and import IP blocklists' __long_description__ = __description__ -__pkg_data__ = {'deluge.plugins.' + __plugin_name__.lower(): ['data/*']} +__pkg_data__ = {'deluge_' + __plugin_name__.lower(): ['data/*']} setup( name=__plugin_name__, @@ -30,15 +30,14 @@ setup( zip_safe=False, long_description=__long_description__, packages=find_packages(), - namespace_packages=['deluge', 'deluge.plugins'], package_data=__pkg_data__, entry_points=""" [deluge.plugin.core] - %s = deluge.plugins.%s:CorePlugin + %s = deluge_%s:CorePlugin [deluge.plugin.gtk3ui] - %s = deluge.plugins.%s:GtkUIPlugin + %s = deluge_%s:GtkUIPlugin [deluge.plugin.web] - %s = deluge.plugins.%s:WebUIPlugin + %s = deluge_%s:WebUIPlugin """ % ((__plugin_name__, __plugin_name__.lower()) * 3), ) diff --git a/deluge/plugins/Execute/deluge/__init__.py b/deluge/plugins/Execute/deluge/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Execute/deluge/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Execute/deluge/plugins/__init__.py b/deluge/plugins/Execute/deluge/plugins/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Execute/deluge/plugins/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Execute/deluge/plugins/execute/common.py b/deluge/plugins/Execute/deluge/plugins/execute/common.py deleted file mode 100644 index de0479129..000000000 --- a/deluge/plugins/Execute/deluge/plugins/execute/common.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Basic plugin template created by: -# Copyright (C) 2008 Martijn Voncken -# 2007-2009 Andrew Resch -# 2009 Damien Churchill -# 2010 Pedro Algarvio -# 2017 Calum Lind -# -# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with -# the additional special exception to link portions of this program with the OpenSSL library. -# See LICENSE for more details. -# - -from __future__ import unicode_literals - -import os.path - -from pkg_resources import resource_filename - - -def get_resource(filename): - return resource_filename('deluge.plugins.execute', os.path.join('data', filename)) diff --git a/deluge/plugins/Execute/deluge/plugins/execute/__init__.py b/deluge/plugins/Execute/deluge_execute/__init__.py similarity index 100% rename from deluge/plugins/Execute/deluge/plugins/execute/__init__.py rename to deluge/plugins/Execute/deluge_execute/__init__.py diff --git a/deluge/plugins/Label/deluge/plugins/label/common.py b/deluge/plugins/Execute/deluge_execute/common.py similarity index 89% rename from deluge/plugins/Label/deluge/plugins/label/common.py rename to deluge/plugins/Execute/deluge_execute/common.py index 16e7d8aa3..4c9db09d5 100644 --- a/deluge/plugins/Label/deluge/plugins/label/common.py +++ b/deluge/plugins/Execute/deluge_execute/common.py @@ -20,4 +20,4 @@ from pkg_resources import resource_filename def get_resource(filename): - return resource_filename('deluge.plugins.label', os.path.join('data', filename)) + return resource_filename(__package__, os.path.join('data', filename)) diff --git a/deluge/plugins/Execute/deluge/plugins/execute/core.py b/deluge/plugins/Execute/deluge_execute/core.py similarity index 100% rename from deluge/plugins/Execute/deluge/plugins/execute/core.py rename to deluge/plugins/Execute/deluge_execute/core.py diff --git a/deluge/plugins/Execute/deluge/plugins/execute/data/execute.js b/deluge/plugins/Execute/deluge_execute/data/execute.js similarity index 100% rename from deluge/plugins/Execute/deluge/plugins/execute/data/execute.js rename to deluge/plugins/Execute/deluge_execute/data/execute.js diff --git a/deluge/plugins/Execute/deluge/plugins/execute/data/execute_prefs.ui b/deluge/plugins/Execute/deluge_execute/data/execute_prefs.ui similarity index 100% rename from deluge/plugins/Execute/deluge/plugins/execute/data/execute_prefs.ui rename to deluge/plugins/Execute/deluge_execute/data/execute_prefs.ui diff --git a/deluge/plugins/Execute/deluge/plugins/execute/gtkui.py b/deluge/plugins/Execute/deluge_execute/gtkui.py similarity index 100% rename from deluge/plugins/Execute/deluge/plugins/execute/gtkui.py rename to deluge/plugins/Execute/deluge_execute/gtkui.py diff --git a/deluge/plugins/Execute/deluge/plugins/execute/webui.py b/deluge/plugins/Execute/deluge_execute/webui.py similarity index 100% rename from deluge/plugins/Execute/deluge/plugins/execute/webui.py rename to deluge/plugins/Execute/deluge_execute/webui.py diff --git a/deluge/plugins/Execute/setup.py b/deluge/plugins/Execute/setup.py index d2156a8df..174d1a356 100644 --- a/deluge/plugins/Execute/setup.py +++ b/deluge/plugins/Execute/setup.py @@ -17,7 +17,7 @@ __url__ = 'http://deluge-torrent.org' __license__ = 'GPLv3' __description__ = 'Plugin to execute a command upon an event' __long_description__ = __description__ -__pkg_data__ = {'deluge.plugins.' + __plugin_name__.lower(): ['data/*']} +__pkg_data__ = {'deluge_' + __plugin_name__.lower(): ['data/*']} setup( name=__plugin_name__, @@ -29,15 +29,14 @@ setup( license=__license__, long_description=__long_description__, packages=find_packages(), - namespace_packages=['deluge', 'deluge.plugins'], package_data=__pkg_data__, entry_points=""" [deluge.plugin.core] - %s = deluge.plugins.%s:CorePlugin + %s = deluge_%s:CorePlugin [deluge.plugin.gtk3ui] - %s = deluge.plugins.%s:GtkUIPlugin + %s = deluge_%s:GtkUIPlugin [deluge.plugin.web] - %s = deluge.plugins.%s:WebUIPlugin + %s = deluge_%s:WebUIPlugin """ % ((__plugin_name__, __plugin_name__.lower()) * 3), ) diff --git a/deluge/plugins/Extractor/deluge/__init__.py b/deluge/plugins/Extractor/deluge/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Extractor/deluge/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Extractor/deluge/plugins/__init__.py b/deluge/plugins/Extractor/deluge/plugins/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Extractor/deluge/plugins/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Extractor/deluge/plugins/extractor/common.py b/deluge/plugins/Extractor/deluge/plugins/extractor/common.py deleted file mode 100644 index 5d6ab1511..000000000 --- a/deluge/plugins/Extractor/deluge/plugins/extractor/common.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Basic plugin template created by: -# Copyright (C) 2008 Martijn Voncken -# 2007-2009 Andrew Resch -# 2009 Damien Churchill -# 2010 Pedro Algarvio -# 2017 Calum Lind -# -# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with -# the additional special exception to link portions of this program with the OpenSSL library. -# See LICENSE for more details. -# - -from __future__ import unicode_literals - -import os.path - -from pkg_resources import resource_filename - - -def get_resource(filename): - return resource_filename('deluge.plugins.extractor', os.path.join('data', filename)) diff --git a/deluge/plugins/Extractor/deluge/plugins/extractor/__init__.py b/deluge/plugins/Extractor/deluge_extractor/__init__.py similarity index 100% rename from deluge/plugins/Extractor/deluge/plugins/extractor/__init__.py rename to deluge/plugins/Extractor/deluge_extractor/__init__.py diff --git a/deluge/plugins/WebUi/deluge/plugins/webui/common.py b/deluge/plugins/Extractor/deluge_extractor/common.py similarity index 89% rename from deluge/plugins/WebUi/deluge/plugins/webui/common.py rename to deluge/plugins/Extractor/deluge_extractor/common.py index 0a9d6574f..4c9db09d5 100644 --- a/deluge/plugins/WebUi/deluge/plugins/webui/common.py +++ b/deluge/plugins/Extractor/deluge_extractor/common.py @@ -20,4 +20,4 @@ from pkg_resources import resource_filename def get_resource(filename): - return resource_filename('deluge.plugins.webui', os.path.join('data', filename)) + return resource_filename(__package__, os.path.join('data', filename)) diff --git a/deluge/plugins/Extractor/deluge/plugins/extractor/core.py b/deluge/plugins/Extractor/deluge_extractor/core.py similarity index 100% rename from deluge/plugins/Extractor/deluge/plugins/extractor/core.py rename to deluge/plugins/Extractor/deluge_extractor/core.py diff --git a/deluge/plugins/Extractor/deluge/plugins/extractor/data/extractor.js b/deluge/plugins/Extractor/deluge_extractor/data/extractor.js similarity index 100% rename from deluge/plugins/Extractor/deluge/plugins/extractor/data/extractor.js rename to deluge/plugins/Extractor/deluge_extractor/data/extractor.js diff --git a/deluge/plugins/Extractor/deluge/plugins/extractor/data/extractor_prefs.ui b/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui similarity index 100% rename from deluge/plugins/Extractor/deluge/plugins/extractor/data/extractor_prefs.ui rename to deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui diff --git a/deluge/plugins/Extractor/deluge/plugins/extractor/gtkui.py b/deluge/plugins/Extractor/deluge_extractor/gtkui.py similarity index 100% rename from deluge/plugins/Extractor/deluge/plugins/extractor/gtkui.py rename to deluge/plugins/Extractor/deluge_extractor/gtkui.py diff --git a/deluge/plugins/Extractor/deluge/plugins/extractor/webui.py b/deluge/plugins/Extractor/deluge_extractor/webui.py similarity index 100% rename from deluge/plugins/Extractor/deluge/plugins/extractor/webui.py rename to deluge/plugins/Extractor/deluge_extractor/webui.py diff --git a/deluge/plugins/Extractor/setup.py b/deluge/plugins/Extractor/setup.py index dded10238..25ab153b3 100644 --- a/deluge/plugins/Extractor/setup.py +++ b/deluge/plugins/Extractor/setup.py @@ -30,7 +30,7 @@ Windows support: .rar, .zip, .tar, .7z, .xz, .lzma Note: Will not extract with 'Move Completed' enabled """ -__pkg_data__ = {'deluge.plugins.' + __plugin_name__.lower(): ['template/*', 'data/*']} +__pkg_data__ = {'deluge_' + __plugin_name__.lower(): ['data/*']} setup( name=__plugin_name__, @@ -42,15 +42,14 @@ setup( license=__license__, long_description=__long_description__ if __long_description__ else __description__, packages=find_packages(), - namespace_packages=['deluge', 'deluge.plugins'], package_data=__pkg_data__, entry_points=""" [deluge.plugin.core] - %s = deluge.plugins.%s:CorePlugin + %s = deluge_%s:CorePlugin [deluge.plugin.gtk3ui] - %s = deluge.plugins.%s:GtkUIPlugin + %s = deluge_%s:GtkUIPlugin [deluge.plugin.web] - %s = deluge.plugins.%s:WebUIPlugin + %s = deluge_%s:WebUIPlugin """ % ((__plugin_name__, __plugin_name__.lower()) * 3), ) diff --git a/deluge/plugins/Label/deluge/__init__.py b/deluge/plugins/Label/deluge/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Label/deluge/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Label/deluge/plugins/__init__.py b/deluge/plugins/Label/deluge/plugins/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Label/deluge/plugins/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Label/deluge/plugins/label/__init__.py b/deluge/plugins/Label/deluge_label/__init__.py similarity index 100% rename from deluge/plugins/Label/deluge/plugins/label/__init__.py rename to deluge/plugins/Label/deluge_label/__init__.py diff --git a/deluge/plugins/Stats/deluge/plugins/stats/common.py b/deluge/plugins/Label/deluge_label/common.py similarity index 89% rename from deluge/plugins/Stats/deluge/plugins/stats/common.py rename to deluge/plugins/Label/deluge_label/common.py index f70d711d6..4c9db09d5 100644 --- a/deluge/plugins/Stats/deluge/plugins/stats/common.py +++ b/deluge/plugins/Label/deluge_label/common.py @@ -20,4 +20,4 @@ from pkg_resources import resource_filename def get_resource(filename): - return resource_filename('deluge.plugins.stats', os.path.join('data', filename)) + return resource_filename(__package__, os.path.join('data', filename)) diff --git a/deluge/plugins/Label/deluge/plugins/label/core.py b/deluge/plugins/Label/deluge_label/core.py similarity index 100% rename from deluge/plugins/Label/deluge/plugins/label/core.py rename to deluge/plugins/Label/deluge_label/core.py diff --git a/deluge/plugins/Label/deluge/plugins/label/data/label.js b/deluge/plugins/Label/deluge_label/data/label.js similarity index 100% rename from deluge/plugins/Label/deluge/plugins/label/data/label.js rename to deluge/plugins/Label/deluge_label/data/label.js diff --git a/deluge/plugins/Label/deluge/plugins/label/data/label_add.ui b/deluge/plugins/Label/deluge_label/data/label_add.ui similarity index 100% rename from deluge/plugins/Label/deluge/plugins/label/data/label_add.ui rename to deluge/plugins/Label/deluge_label/data/label_add.ui diff --git a/deluge/plugins/Label/deluge/plugins/label/data/label_options.ui b/deluge/plugins/Label/deluge_label/data/label_options.ui similarity index 100% rename from deluge/plugins/Label/deluge/plugins/label/data/label_options.ui rename to deluge/plugins/Label/deluge_label/data/label_options.ui diff --git a/deluge/plugins/Label/deluge/plugins/label/data/label_pref.ui b/deluge/plugins/Label/deluge_label/data/label_pref.ui similarity index 100% rename from deluge/plugins/Label/deluge/plugins/label/data/label_pref.ui rename to deluge/plugins/Label/deluge_label/data/label_pref.ui diff --git a/deluge/plugins/Label/deluge/plugins/label/gtkui/__init__.py b/deluge/plugins/Label/deluge_label/gtkui/__init__.py similarity index 100% rename from deluge/plugins/Label/deluge/plugins/label/gtkui/__init__.py rename to deluge/plugins/Label/deluge_label/gtkui/__init__.py diff --git a/deluge/plugins/Label/deluge/plugins/label/gtkui/label_config.py b/deluge/plugins/Label/deluge_label/gtkui/label_config.py similarity index 100% rename from deluge/plugins/Label/deluge/plugins/label/gtkui/label_config.py rename to deluge/plugins/Label/deluge_label/gtkui/label_config.py diff --git a/deluge/plugins/Label/deluge/plugins/label/gtkui/sidebar_menu.py b/deluge/plugins/Label/deluge_label/gtkui/sidebar_menu.py similarity index 100% rename from deluge/plugins/Label/deluge/plugins/label/gtkui/sidebar_menu.py rename to deluge/plugins/Label/deluge_label/gtkui/sidebar_menu.py diff --git a/deluge/plugins/Label/deluge/plugins/label/gtkui/submenu.py b/deluge/plugins/Label/deluge_label/gtkui/submenu.py similarity index 100% rename from deluge/plugins/Label/deluge/plugins/label/gtkui/submenu.py rename to deluge/plugins/Label/deluge_label/gtkui/submenu.py diff --git a/deluge/plugins/Label/deluge/plugins/label/test.py b/deluge/plugins/Label/deluge_label/test.py similarity index 100% rename from deluge/plugins/Label/deluge/plugins/label/test.py rename to deluge/plugins/Label/deluge_label/test.py diff --git a/deluge/plugins/Label/deluge/plugins/label/webui.py b/deluge/plugins/Label/deluge_label/webui.py similarity index 100% rename from deluge/plugins/Label/deluge/plugins/label/webui.py rename to deluge/plugins/Label/deluge_label/webui.py diff --git a/deluge/plugins/Label/setup.py b/deluge/plugins/Label/setup.py index a6907563b..567335be2 100644 --- a/deluge/plugins/Label/setup.py +++ b/deluge/plugins/Label/setup.py @@ -21,7 +21,7 @@ Allows labels to be assigned to torrents Also offers filters on state, tracker and keywords """ -__pkg_data__ = {'deluge.plugins.' + __plugin_name__.lower(): ['template/*', 'data/*']} +__pkg_data__ = {'deluge_' + __plugin_name__.lower(): ['data/*']} setup( name=__plugin_name__, @@ -33,15 +33,14 @@ setup( license=__license__, long_description=__long_description__, packages=find_packages(), - namespace_packages=['deluge', 'deluge.plugins'], package_data=__pkg_data__, entry_points=""" [deluge.plugin.core] - %s = deluge.plugins.%s:CorePlugin + %s = deluge_%s:CorePlugin [deluge.plugin.gtk3ui] - %s = deluge.plugins.%s:GtkUIPlugin + %s = deluge_%s:GtkUIPlugin [deluge.plugin.web] - %s = deluge.plugins.%s:WebUIPlugin + %s = deluge_%s:WebUIPlugin """ % ((__plugin_name__, __plugin_name__.lower()) * 3), ) diff --git a/deluge/plugins/Notifications/deluge/__init__.py b/deluge/plugins/Notifications/deluge/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Notifications/deluge/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Notifications/deluge/plugins/__init__.py b/deluge/plugins/Notifications/deluge/plugins/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Notifications/deluge/plugins/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Notifications/deluge/plugins/notifications/__init__.py b/deluge/plugins/Notifications/deluge_notifications/__init__.py similarity index 100% rename from deluge/plugins/Notifications/deluge/plugins/notifications/__init__.py rename to deluge/plugins/Notifications/deluge_notifications/__init__.py diff --git a/deluge/plugins/Notifications/deluge/plugins/notifications/common.py b/deluge/plugins/Notifications/deluge_notifications/common.py similarity index 97% rename from deluge/plugins/Notifications/deluge/plugins/notifications/common.py rename to deluge/plugins/Notifications/deluge_notifications/common.py index 8284d9700..6966122ca 100644 --- a/deluge/plugins/Notifications/deluge/plugins/notifications/common.py +++ b/deluge/plugins/Notifications/deluge_notifications/common.py @@ -27,9 +27,7 @@ log = logging.getLogger(__name__) def get_resource(filename): - return resource_filename( - 'deluge.plugins.notifications', os.path.join('data', filename) - ) + return resource_filename(__package__, os.path.join('data', filename)) class CustomNotifications(object): diff --git a/deluge/plugins/Notifications/deluge/plugins/notifications/core.py b/deluge/plugins/Notifications/deluge_notifications/core.py similarity index 100% rename from deluge/plugins/Notifications/deluge/plugins/notifications/core.py rename to deluge/plugins/Notifications/deluge_notifications/core.py diff --git a/deluge/plugins/Notifications/deluge/plugins/notifications/data/config.ui b/deluge/plugins/Notifications/deluge_notifications/data/config.ui similarity index 100% rename from deluge/plugins/Notifications/deluge/plugins/notifications/data/config.ui rename to deluge/plugins/Notifications/deluge_notifications/data/config.ui diff --git a/deluge/plugins/Notifications/deluge/plugins/notifications/data/notifications.js b/deluge/plugins/Notifications/deluge_notifications/data/notifications.js similarity index 100% rename from deluge/plugins/Notifications/deluge/plugins/notifications/data/notifications.js rename to deluge/plugins/Notifications/deluge_notifications/data/notifications.js diff --git a/deluge/plugins/Notifications/deluge/plugins/notifications/gtkui.py b/deluge/plugins/Notifications/deluge_notifications/gtkui.py similarity index 100% rename from deluge/plugins/Notifications/deluge/plugins/notifications/gtkui.py rename to deluge/plugins/Notifications/deluge_notifications/gtkui.py diff --git a/deluge/plugins/Notifications/deluge/plugins/notifications/test.py b/deluge/plugins/Notifications/deluge_notifications/test.py similarity index 100% rename from deluge/plugins/Notifications/deluge/plugins/notifications/test.py rename to deluge/plugins/Notifications/deluge_notifications/test.py diff --git a/deluge/plugins/Notifications/deluge/plugins/notifications/webui.py b/deluge/plugins/Notifications/deluge_notifications/webui.py similarity index 100% rename from deluge/plugins/Notifications/deluge/plugins/notifications/webui.py rename to deluge/plugins/Notifications/deluge_notifications/webui.py diff --git a/deluge/plugins/Notifications/setup.py b/deluge/plugins/Notifications/setup.py index c96999c98..d9a9e4227 100755 --- a/deluge/plugins/Notifications/setup.py +++ b/deluge/plugins/Notifications/setup.py @@ -29,7 +29,7 @@ Email, Popup, Blink and Sound notifications The plugin also allows other plugins to make use of itself for their own custom notifications """ -__pkg_data__ = {'deluge.plugins.' + __plugin_name__.lower(): ['template/*', 'data/*']} +__pkg_data__ = {'deluge_' + __plugin_name__.lower(): ['data/*']} setup( name=__plugin_name__, @@ -40,16 +40,15 @@ setup( url=__url__, license=__license__, long_description=__long_description__ if __long_description__ else __description__, - packages=find_packages(exclude=['**/test.py']), - namespace_packages=['deluge', 'deluge.plugins'], + packages=find_packages(), package_data=__pkg_data__, entry_points=""" [deluge.plugin.core] - %s = deluge.plugins.%s:CorePlugin + %s = deluge_%s:CorePlugin [deluge.plugin.gtk3ui] - %s = deluge.plugins.%s:GtkUIPlugin + %s = deluge_%s:GtkUIPlugin [deluge.plugin.web] - %s = deluge.plugins.%s:WebUIPlugin + %s = deluge_%s:WebUIPlugin """ % ((__plugin_name__, __plugin_name__.lower()) * 3), ) diff --git a/deluge/plugins/Scheduler/deluge/__init__.py b/deluge/plugins/Scheduler/deluge/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Scheduler/deluge/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Scheduler/deluge/plugins/__init__.py b/deluge/plugins/Scheduler/deluge/plugins/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Scheduler/deluge/plugins/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Scheduler/deluge/plugins/scheduler/common.py b/deluge/plugins/Scheduler/deluge/plugins/scheduler/common.py deleted file mode 100644 index 27cd79af7..000000000 --- a/deluge/plugins/Scheduler/deluge/plugins/scheduler/common.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Basic plugin template created by: -# Copyright (C) 2008 Martijn Voncken -# 2007-2009 Andrew Resch -# 2009 Damien Churchill -# 2010 Pedro Algarvio -# 2017 Calum Lind -# -# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with -# the additional special exception to link portions of this program with the OpenSSL library. -# See LICENSE for more details. -# - -from __future__ import unicode_literals - -import os.path - -from pkg_resources import resource_filename - - -def get_resource(filename): - return resource_filename('deluge.plugins.scheduler', os.path.join('data', filename)) diff --git a/deluge/plugins/Scheduler/deluge/plugins/scheduler/__init__.py b/deluge/plugins/Scheduler/deluge_scheduler/__init__.py similarity index 100% rename from deluge/plugins/Scheduler/deluge/plugins/scheduler/__init__.py rename to deluge/plugins/Scheduler/deluge_scheduler/__init__.py diff --git a/deluge/plugins/Toggle/deluge/plugins/toggle/common.py b/deluge/plugins/Scheduler/deluge_scheduler/common.py similarity index 89% rename from deluge/plugins/Toggle/deluge/plugins/toggle/common.py rename to deluge/plugins/Scheduler/deluge_scheduler/common.py index 60f6ac149..4c9db09d5 100644 --- a/deluge/plugins/Toggle/deluge/plugins/toggle/common.py +++ b/deluge/plugins/Scheduler/deluge_scheduler/common.py @@ -20,4 +20,4 @@ from pkg_resources import resource_filename def get_resource(filename): - return resource_filename('deluge.plugins.toggle', os.path.join('data', filename)) + return resource_filename(__package__, os.path.join('data', filename)) diff --git a/deluge/plugins/Scheduler/deluge/plugins/scheduler/core.py b/deluge/plugins/Scheduler/deluge_scheduler/core.py similarity index 100% rename from deluge/plugins/Scheduler/deluge/plugins/scheduler/core.py rename to deluge/plugins/Scheduler/deluge_scheduler/core.py diff --git a/deluge/plugins/Scheduler/deluge/plugins/scheduler/data/green.svg b/deluge/plugins/Scheduler/deluge_scheduler/data/green.svg similarity index 100% rename from deluge/plugins/Scheduler/deluge/plugins/scheduler/data/green.svg rename to deluge/plugins/Scheduler/deluge_scheduler/data/green.svg diff --git a/deluge/plugins/Scheduler/deluge/plugins/scheduler/data/red.svg b/deluge/plugins/Scheduler/deluge_scheduler/data/red.svg similarity index 100% rename from deluge/plugins/Scheduler/deluge/plugins/scheduler/data/red.svg rename to deluge/plugins/Scheduler/deluge_scheduler/data/red.svg diff --git a/deluge/plugins/Scheduler/deluge/plugins/scheduler/data/scheduler.js b/deluge/plugins/Scheduler/deluge_scheduler/data/scheduler.js similarity index 100% rename from deluge/plugins/Scheduler/deluge/plugins/scheduler/data/scheduler.js rename to deluge/plugins/Scheduler/deluge_scheduler/data/scheduler.js diff --git a/deluge/plugins/Scheduler/deluge/plugins/scheduler/data/yellow.svg b/deluge/plugins/Scheduler/deluge_scheduler/data/yellow.svg similarity index 100% rename from deluge/plugins/Scheduler/deluge/plugins/scheduler/data/yellow.svg rename to deluge/plugins/Scheduler/deluge_scheduler/data/yellow.svg diff --git a/deluge/plugins/Scheduler/deluge/plugins/scheduler/gtkui.py b/deluge/plugins/Scheduler/deluge_scheduler/gtkui.py similarity index 100% rename from deluge/plugins/Scheduler/deluge/plugins/scheduler/gtkui.py rename to deluge/plugins/Scheduler/deluge_scheduler/gtkui.py diff --git a/deluge/plugins/Scheduler/deluge/plugins/scheduler/webui.py b/deluge/plugins/Scheduler/deluge_scheduler/webui.py similarity index 100% rename from deluge/plugins/Scheduler/deluge/plugins/scheduler/webui.py rename to deluge/plugins/Scheduler/deluge_scheduler/webui.py diff --git a/deluge/plugins/Scheduler/setup.py b/deluge/plugins/Scheduler/setup.py index 4d62051fe..71b69e9f9 100644 --- a/deluge/plugins/Scheduler/setup.py +++ b/deluge/plugins/Scheduler/setup.py @@ -21,7 +21,7 @@ __url__ = 'http://deluge-torrent.org' __license__ = 'GPLv3' __description__ = 'Schedule limits on a per-hour per-day basis.' __long_description__ = """""" -__pkg_data__ = {'deluge.plugins.' + __plugin_name__.lower(): ['template/*', 'data/*']} +__pkg_data__ = {'deluge_' + __plugin_name__.lower(): ['data/*']} setup( name=__plugin_name__, @@ -33,15 +33,14 @@ setup( license=__license__, long_description=__long_description__ if __long_description__ else __description__, packages=find_packages(), - namespace_packages=['deluge', 'deluge.plugins'], package_data=__pkg_data__, entry_points=""" [deluge.plugin.core] - %s = deluge.plugins.%s:CorePlugin + %s = deluge_%s:CorePlugin [deluge.plugin.gtk3ui] - %s = deluge.plugins.%s:GtkUIPlugin + %s = deluge_%s:GtkUIPlugin [deluge.plugin.web] - %s = deluge.plugins.%s:WebUIPlugin + %s = deluge_%s:WebUIPlugin """ % ((__plugin_name__, __plugin_name__.lower()) * 3), ) diff --git a/deluge/plugins/Stats/deluge/__init__.py b/deluge/plugins/Stats/deluge/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Stats/deluge/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Stats/deluge/plugins/__init__.py b/deluge/plugins/Stats/deluge/plugins/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Stats/deluge/plugins/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Stats/deluge/plugins/stats/__init__.py b/deluge/plugins/Stats/deluge_stats/__init__.py similarity index 100% rename from deluge/plugins/Stats/deluge/plugins/stats/__init__.py rename to deluge/plugins/Stats/deluge_stats/__init__.py diff --git a/deluge/plugins/Stats/deluge_stats/common.py b/deluge/plugins/Stats/deluge_stats/common.py new file mode 100644 index 000000000..4c9db09d5 --- /dev/null +++ b/deluge/plugins/Stats/deluge_stats/common.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# +# Basic plugin template created by: +# Copyright (C) 2008 Martijn Voncken +# 2007-2009 Andrew Resch +# 2009 Damien Churchill +# 2010 Pedro Algarvio +# 2017 Calum Lind +# +# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with +# the additional special exception to link portions of this program with the OpenSSL library. +# See LICENSE for more details. +# + +from __future__ import unicode_literals + +import os.path + +from pkg_resources import resource_filename + + +def get_resource(filename): + return resource_filename(__package__, os.path.join('data', filename)) diff --git a/deluge/plugins/Stats/deluge/plugins/stats/core.py b/deluge/plugins/Stats/deluge_stats/core.py similarity index 100% rename from deluge/plugins/Stats/deluge/plugins/stats/core.py rename to deluge/plugins/Stats/deluge_stats/core.py diff --git a/deluge/plugins/Stats/deluge/plugins/stats/data/config.ui b/deluge/plugins/Stats/deluge_stats/data/config.ui similarity index 100% rename from deluge/plugins/Stats/deluge/plugins/stats/data/config.ui rename to deluge/plugins/Stats/deluge_stats/data/config.ui diff --git a/deluge/plugins/Stats/deluge/plugins/stats/data/stats.js b/deluge/plugins/Stats/deluge_stats/data/stats.js similarity index 100% rename from deluge/plugins/Stats/deluge/plugins/stats/data/stats.js rename to deluge/plugins/Stats/deluge_stats/data/stats.js diff --git a/deluge/plugins/Stats/deluge/plugins/stats/data/tabs.ui b/deluge/plugins/Stats/deluge_stats/data/tabs.ui similarity index 100% rename from deluge/plugins/Stats/deluge/plugins/stats/data/tabs.ui rename to deluge/plugins/Stats/deluge_stats/data/tabs.ui diff --git a/deluge/plugins/Stats/deluge/plugins/stats/graph.py b/deluge/plugins/Stats/deluge_stats/graph.py similarity index 100% rename from deluge/plugins/Stats/deluge/plugins/stats/graph.py rename to deluge/plugins/Stats/deluge_stats/graph.py diff --git a/deluge/plugins/Stats/deluge/plugins/stats/gtkui.py b/deluge/plugins/Stats/deluge_stats/gtkui.py similarity index 100% rename from deluge/plugins/Stats/deluge/plugins/stats/gtkui.py rename to deluge/plugins/Stats/deluge_stats/gtkui.py diff --git a/deluge/plugins/Stats/deluge/plugins/stats/template/graph.html b/deluge/plugins/Stats/deluge_stats/template/graph.html similarity index 100% rename from deluge/plugins/Stats/deluge/plugins/stats/template/graph.html rename to deluge/plugins/Stats/deluge_stats/template/graph.html diff --git a/deluge/plugins/Stats/deluge/plugins/stats/tests/__init__.py b/deluge/plugins/Stats/deluge_stats/tests/__init__.py similarity index 100% rename from deluge/plugins/Stats/deluge/plugins/stats/tests/__init__.py rename to deluge/plugins/Stats/deluge_stats/tests/__init__.py diff --git a/deluge/plugins/Stats/deluge/plugins/stats/tests/test.html b/deluge/plugins/Stats/deluge_stats/tests/test.html similarity index 100% rename from deluge/plugins/Stats/deluge/plugins/stats/tests/test.html rename to deluge/plugins/Stats/deluge_stats/tests/test.html diff --git a/deluge/plugins/Stats/deluge/plugins/stats/tests/test_stats.py b/deluge/plugins/Stats/deluge_stats/tests/test_stats.py similarity index 98% rename from deluge/plugins/Stats/deluge/plugins/stats/tests/test_stats.py rename to deluge/plugins/Stats/deluge_stats/tests/test_stats.py index 60dd7768f..3b581be3e 100644 --- a/deluge/plugins/Stats/deluge/plugins/stats/tests/test_stats.py +++ b/deluge/plugins/Stats/deluge_stats/tests/test_stats.py @@ -79,7 +79,7 @@ class StatsTestCase(BaseTestCase): from deluge.ui.gtkui.pluginmanager import PluginManager from deluge.ui.gtkui.torrentdetails import TorrentDetails from deluge.ui.gtkui.torrentview import TorrentView - from deluge.plugins.Stats.deluge.plugins.stats import graph, gtkui + from deluge_stats import graph, gtkui ConfigManager('gtkui.conf', defaults=DEFAULT_PREFS) diff --git a/deluge/plugins/Stats/deluge/plugins/stats/webui.py b/deluge/plugins/Stats/deluge_stats/webui.py similarity index 100% rename from deluge/plugins/Stats/deluge/plugins/stats/webui.py rename to deluge/plugins/Stats/deluge_stats/webui.py diff --git a/deluge/plugins/Stats/setup.py b/deluge/plugins/Stats/setup.py index 65d36941e..174c652a9 100644 --- a/deluge/plugins/Stats/setup.py +++ b/deluge/plugins/Stats/setup.py @@ -25,7 +25,7 @@ __long_description__ = """ Records lots of extra stats and produces time series graphs""" -__pkg_data__ = {'deluge.plugins.' + __plugin_name__.lower(): ['template/*', 'data/*']} +__pkg_data__ = {'deluge_' + __plugin_name__.lower(): ['template/*', 'data/*']} setup( name=__plugin_name__, @@ -37,15 +37,14 @@ setup( license=__license__, long_description=__long_description__, packages=find_packages(), - namespace_packages=['deluge', 'deluge.plugins'], package_data=__pkg_data__, entry_points=""" [deluge.plugin.core] - %s = deluge.plugins.%s:CorePlugin + %s = deluge_%s:CorePlugin [deluge.plugin.gtk3ui] - %s = deluge.plugins.%s:GtkUIPlugin + %s = deluge_%s:GtkUIPlugin [deluge.plugin.web] - %s = deluge.plugins.%s:WebUIPlugin + %s = deluge_%s:WebUIPlugin """ % ((__plugin_name__, __plugin_name__.lower()) * 3), ) diff --git a/deluge/plugins/Toggle/deluge/__init__.py b/deluge/plugins/Toggle/deluge/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Toggle/deluge/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Toggle/deluge/plugins/__init__.py b/deluge/plugins/Toggle/deluge/plugins/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/Toggle/deluge/plugins/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Toggle/deluge/plugins/toggle/__init__.py b/deluge/plugins/Toggle/deluge_toggle/__init__.py similarity index 100% rename from deluge/plugins/Toggle/deluge/plugins/toggle/__init__.py rename to deluge/plugins/Toggle/deluge_toggle/__init__.py diff --git a/deluge/plugins/Toggle/deluge_toggle/common.py b/deluge/plugins/Toggle/deluge_toggle/common.py new file mode 100644 index 000000000..4c9db09d5 --- /dev/null +++ b/deluge/plugins/Toggle/deluge_toggle/common.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# +# Basic plugin template created by: +# Copyright (C) 2008 Martijn Voncken +# 2007-2009 Andrew Resch +# 2009 Damien Churchill +# 2010 Pedro Algarvio +# 2017 Calum Lind +# +# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with +# the additional special exception to link portions of this program with the OpenSSL library. +# See LICENSE for more details. +# + +from __future__ import unicode_literals + +import os.path + +from pkg_resources import resource_filename + + +def get_resource(filename): + return resource_filename(__package__, os.path.join('data', filename)) diff --git a/deluge/plugins/Toggle/deluge/plugins/toggle/core.py b/deluge/plugins/Toggle/deluge_toggle/core.py similarity index 100% rename from deluge/plugins/Toggle/deluge/plugins/toggle/core.py rename to deluge/plugins/Toggle/deluge_toggle/core.py diff --git a/deluge/plugins/Toggle/deluge/plugins/toggle/data/toggle.js b/deluge/plugins/Toggle/deluge_toggle/data/toggle.js similarity index 100% rename from deluge/plugins/Toggle/deluge/plugins/toggle/data/toggle.js rename to deluge/plugins/Toggle/deluge_toggle/data/toggle.js diff --git a/deluge/plugins/Toggle/deluge/plugins/toggle/gtkui.py b/deluge/plugins/Toggle/deluge_toggle/gtkui.py similarity index 100% rename from deluge/plugins/Toggle/deluge/plugins/toggle/gtkui.py rename to deluge/plugins/Toggle/deluge_toggle/gtkui.py diff --git a/deluge/plugins/Toggle/deluge/plugins/toggle/webui.py b/deluge/plugins/Toggle/deluge_toggle/webui.py similarity index 100% rename from deluge/plugins/Toggle/deluge/plugins/toggle/webui.py rename to deluge/plugins/Toggle/deluge_toggle/webui.py diff --git a/deluge/plugins/Toggle/setup.py b/deluge/plugins/Toggle/setup.py index 54d9ee228..acc6e6c7d 100644 --- a/deluge/plugins/Toggle/setup.py +++ b/deluge/plugins/Toggle/setup.py @@ -22,7 +22,7 @@ __url__ = 'http://deluge-torrent.org' __license__ = 'GPLv3' __description__ = 'Toggles the session' __long_description__ = """""" -__pkg_data__ = {'deluge.plugins.' + __plugin_name__.lower(): ['template/*', 'data/*']} +__pkg_data__ = {'deluge_' + __plugin_name__.lower(): ['data/*']} setup( name=__plugin_name__, @@ -34,15 +34,14 @@ setup( license=__license__, long_description=__long_description__ if __long_description__ else __description__, packages=find_packages(), - namespace_packages=['deluge', 'deluge.plugins'], package_data=__pkg_data__, entry_points=""" [deluge.plugin.core] - %s = deluge.plugins.%s:CorePlugin + %s = deluge_%s:CorePlugin [deluge.plugin.gtk3ui] - %s = deluge.plugins.%s:GtkUIPlugin + %s = deluge_%s:GtkUIPlugin [deluge.plugin.web] - %s = deluge.plugins.%s:WebUIPlugin + %s = deluge_%s:WebUIPlugin """ % ((__plugin_name__, __plugin_name__.lower()) * 3), ) diff --git a/deluge/plugins/WebUi/deluge/__init__.py b/deluge/plugins/WebUi/deluge/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/WebUi/deluge/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/WebUi/deluge/plugins/__init__.py b/deluge/plugins/WebUi/deluge/plugins/__init__.py deleted file mode 100644 index de40ea7ca..000000000 --- a/deluge/plugins/WebUi/deluge/plugins/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/WebUi/deluge/plugins/webui/__init__.py b/deluge/plugins/WebUi/deluge_webui/__init__.py similarity index 100% rename from deluge/plugins/WebUi/deluge/plugins/webui/__init__.py rename to deluge/plugins/WebUi/deluge_webui/__init__.py diff --git a/deluge/plugins/WebUi/deluge_webui/common.py b/deluge/plugins/WebUi/deluge_webui/common.py new file mode 100644 index 000000000..4c9db09d5 --- /dev/null +++ b/deluge/plugins/WebUi/deluge_webui/common.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# +# Basic plugin template created by: +# Copyright (C) 2008 Martijn Voncken +# 2007-2009 Andrew Resch +# 2009 Damien Churchill +# 2010 Pedro Algarvio +# 2017 Calum Lind +# +# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with +# the additional special exception to link portions of this program with the OpenSSL library. +# See LICENSE for more details. +# + +from __future__ import unicode_literals + +import os.path + +from pkg_resources import resource_filename + + +def get_resource(filename): + return resource_filename(__package__, os.path.join('data', filename)) diff --git a/deluge/plugins/WebUi/deluge/plugins/webui/core.py b/deluge/plugins/WebUi/deluge_webui/core.py similarity index 100% rename from deluge/plugins/WebUi/deluge/plugins/webui/core.py rename to deluge/plugins/WebUi/deluge_webui/core.py diff --git a/deluge/plugins/WebUi/deluge/plugins/webui/data/config.ui b/deluge/plugins/WebUi/deluge_webui/data/config.ui similarity index 100% rename from deluge/plugins/WebUi/deluge/plugins/webui/data/config.ui rename to deluge/plugins/WebUi/deluge_webui/data/config.ui diff --git a/deluge/plugins/WebUi/deluge/plugins/webui/gtkui.py b/deluge/plugins/WebUi/deluge_webui/gtkui.py similarity index 100% rename from deluge/plugins/WebUi/deluge/plugins/webui/gtkui.py rename to deluge/plugins/WebUi/deluge_webui/gtkui.py diff --git a/deluge/plugins/WebUi/deluge/plugins/webui/tests/__init__.py b/deluge/plugins/WebUi/deluge_webui/tests/__init__.py similarity index 100% rename from deluge/plugins/WebUi/deluge/plugins/webui/tests/__init__.py rename to deluge/plugins/WebUi/deluge_webui/tests/__init__.py diff --git a/deluge/plugins/WebUi/deluge/plugins/webui/tests/test_plugin_webui.py b/deluge/plugins/WebUi/deluge_webui/tests/test_plugin_webui.py similarity index 100% rename from deluge/plugins/WebUi/deluge/plugins/webui/tests/test_plugin_webui.py rename to deluge/plugins/WebUi/deluge_webui/tests/test_plugin_webui.py diff --git a/deluge/plugins/WebUi/setup.py b/deluge/plugins/WebUi/setup.py index 3c110c8ed..861a05a50 100644 --- a/deluge/plugins/WebUi/setup.py +++ b/deluge/plugins/WebUi/setup.py @@ -21,7 +21,7 @@ __url__ = 'http://deluge-torrent.org' __license__ = 'GPLv3' __description__ = 'Allows starting the web interface within the daemon.' __long_description__ = """""" -__pkg_data__ = {'deluge.plugins.' + __plugin_name__.lower(): ['template/*', 'data/*']} +__pkg_data__ = {'deluge_' + __plugin_name__.lower(): ['data/*']} setup( name=__plugin_name__, @@ -33,13 +33,12 @@ setup( license=__license__, long_description=__long_description__ if __long_description__ else __description__, packages=find_packages(), - namespace_packages=['deluge', 'deluge.plugins'], package_data=__pkg_data__, entry_points=""" [deluge.plugin.core] - %s = deluge.plugins.%s:CorePlugin + %s = deluge_%s:CorePlugin [deluge.plugin.gtk3ui] - %s = deluge.plugins.%s:GtkUIPlugin + %s = deluge_%s:GtkUIPlugin """ % ((__plugin_name__, __plugin_name__.lower()) * 2), ) diff --git a/deluge/plugins/__init__.py b/deluge/plugins/__init__.py index de40ea7ca..e69de29bb 100644 --- a/deluge/plugins/__init__.py +++ b/deluge/plugins/__init__.py @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/scripts/create_plugin.py b/deluge/scripts/create_plugin.py index 6479d1f31..5e804efa8 100644 --- a/deluge/scripts/create_plugin.py +++ b/deluge/scripts/create_plugin.py @@ -70,9 +70,7 @@ def create_plugin(): if options.module_name: safe_name = options.module_name.lower() plugin_base = os.path.realpath(os.path.join(options.basepath, name)) - deluge_namespace = os.path.join(plugin_base, 'deluge') - plugins_namespace = os.path.join(deluge_namespace, 'plugins') - src = os.path.join(plugins_namespace, safe_name) + src = os.path.join(plugin_base, 'deluge_' + safe_name) data_dir = os.path.join(src, 'data') python_path = sys.executable @@ -102,15 +100,11 @@ def create_plugin(): print('creating folders..') os.mkdir(plugin_base) - os.mkdir(deluge_namespace) - os.mkdir(plugins_namespace) os.mkdir(src) os.mkdir(data_dir) print('creating files..') write_file(plugin_base, 'setup.py', SETUP) - write_file(deluge_namespace, '__init__.py', NAMESPACE_INIT, False) - write_file(plugins_namespace, '__init__.py', NAMESPACE_INIT, False) write_file(src, '__init__.py', INIT) write_file(src, 'gtk3ui.py', GTK3UI) write_file(src, 'webui.py', WEBUI) @@ -201,7 +195,7 @@ __url__ = '%(url)s' __license__ = 'GPLv3' __description__ = '' __long_description__ = \"\"\"\"\"\" -__pkg_data__ = {'deluge.plugins.'+__plugin_name__.lower(): ['template/*', 'data/*']} +__pkg_data__ = {'deluge_'+__plugin_name__.lower(): ['data/*']} setup( name=__plugin_name__, @@ -214,16 +208,15 @@ setup( long_description=__long_description__, packages=find_packages(), - namespace_packages=['deluge', 'deluge.plugins'], package_data=__pkg_data__, entry_points=\"\"\" [deluge.plugin.core] - %%s = deluge.plugins.%%s:CorePlugin + %%s = deluge_%%s:CorePlugin [deluge.plugin.gtk3ui] - %%s = deluge.plugins.%%s:Gtk3UIPlugin + %%s = deluge_%%s:Gtk3UIPlugin [deluge.plugin.web] - %%s = deluge.plugins.%%s:WebUIPlugin + %%s = deluge_%%s:WebUIPlugin \"\"\" %% ((__plugin_name__, __plugin_name__.lower()) * 3) ) """ @@ -236,8 +229,7 @@ from pkg_resources import resource_filename def get_resource(filename): - return resource_filename( - 'deluge.plugins.%(safe_name)s', os.path.join('data', filename)) + return resource_filename(__package__, os.path.join('data', filename)) """ GTK3UI = """from __future__ import unicode_literals @@ -382,9 +374,6 @@ GPL = """# -*- coding: utf-8 -*- # the OpenSSL library. See LICENSE for more details. """ -NAMESPACE_INIT = """__import__('pkg_resources').declare_namespace(__name__) -""" - CREATE_DEV_LINK = """#!/bin/bash BASEDIR=$(cd `dirname $0` && pwd) CONFIG_DIR=$( test -z $1 && echo "%(configdir)s" || echo "$1") diff --git a/setup.py b/setup.py index 9ff305ef4..8e2d08710 100755 --- a/setup.py +++ b/setup.py @@ -593,6 +593,5 @@ setup( package_data=_package_data, exclude_package_data=_exclude_package_data, packages=find_packages(exclude=['deluge.plugins.*', 'deluge.tests']), - namespace_packages=['deluge', 'deluge.plugins'], entry_points=_entry_points, )