diff --git a/deluge/__init__.py b/deluge/__init__.py index 6dd6930e2..3a58602bd 100644 --- a/deluge/__init__.py +++ b/deluge/__init__.py @@ -1,7 +1,2 @@ """Deluge""" -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/AutoAdd/deluge/__init__.py b/deluge/plugins/AutoAdd/deluge/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/AutoAdd/deluge/__init__.py +++ b/deluge/plugins/AutoAdd/deluge/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/AutoAdd/deluge/plugins/__init__.py b/deluge/plugins/AutoAdd/deluge/plugins/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/AutoAdd/deluge/plugins/__init__.py +++ b/deluge/plugins/AutoAdd/deluge/plugins/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Blocklist/deluge/__init__.py b/deluge/plugins/Blocklist/deluge/__init__.py index c55970686..de40ea7ca 100644 --- a/deluge/plugins/Blocklist/deluge/__init__.py +++ b/deluge/plugins/Blocklist/deluge/__init__.py @@ -1,4 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package __import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Blocklist/deluge/plugins/__init__.py b/deluge/plugins/Blocklist/deluge/plugins/__init__.py index c55970686..de40ea7ca 100644 --- a/deluge/plugins/Blocklist/deluge/plugins/__init__.py +++ b/deluge/plugins/Blocklist/deluge/plugins/__init__.py @@ -1,4 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package __import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Execute/deluge/__init__.py b/deluge/plugins/Execute/deluge/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Execute/deluge/__init__.py +++ b/deluge/plugins/Execute/deluge/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Execute/deluge/plugins/__init__.py b/deluge/plugins/Execute/deluge/plugins/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Execute/deluge/plugins/__init__.py +++ b/deluge/plugins/Execute/deluge/plugins/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Extractor/deluge/__init__.py b/deluge/plugins/Extractor/deluge/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Extractor/deluge/__init__.py +++ b/deluge/plugins/Extractor/deluge/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Extractor/deluge/plugins/__init__.py b/deluge/plugins/Extractor/deluge/plugins/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Extractor/deluge/plugins/__init__.py +++ b/deluge/plugins/Extractor/deluge/plugins/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Label/deluge/__init__.py b/deluge/plugins/Label/deluge/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Label/deluge/__init__.py +++ b/deluge/plugins/Label/deluge/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Label/deluge/plugins/__init__.py b/deluge/plugins/Label/deluge/plugins/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Label/deluge/plugins/__init__.py +++ b/deluge/plugins/Label/deluge/plugins/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Notifications/deluge/__init__.py b/deluge/plugins/Notifications/deluge/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Notifications/deluge/__init__.py +++ b/deluge/plugins/Notifications/deluge/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Notifications/deluge/plugins/__init__.py b/deluge/plugins/Notifications/deluge/plugins/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Notifications/deluge/plugins/__init__.py +++ b/deluge/plugins/Notifications/deluge/plugins/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Scheduler/deluge/__init__.py b/deluge/plugins/Scheduler/deluge/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Scheduler/deluge/__init__.py +++ b/deluge/plugins/Scheduler/deluge/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Scheduler/deluge/plugins/__init__.py b/deluge/plugins/Scheduler/deluge/plugins/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Scheduler/deluge/plugins/__init__.py +++ b/deluge/plugins/Scheduler/deluge/plugins/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Stats/deluge/__init__.py b/deluge/plugins/Stats/deluge/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Stats/deluge/__init__.py +++ b/deluge/plugins/Stats/deluge/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Stats/deluge/plugins/__init__.py b/deluge/plugins/Stats/deluge/plugins/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Stats/deluge/plugins/__init__.py +++ b/deluge/plugins/Stats/deluge/plugins/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Toggle/deluge/__init__.py b/deluge/plugins/Toggle/deluge/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Toggle/deluge/__init__.py +++ b/deluge/plugins/Toggle/deluge/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/Toggle/deluge/plugins/__init__.py b/deluge/plugins/Toggle/deluge/plugins/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/Toggle/deluge/plugins/__init__.py +++ b/deluge/plugins/Toggle/deluge/plugins/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/WebUi/deluge/__init__.py b/deluge/plugins/WebUi/deluge/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/WebUi/deluge/__init__.py +++ b/deluge/plugins/WebUi/deluge/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/WebUi/deluge/plugins/__init__.py b/deluge/plugins/WebUi/deluge/plugins/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/WebUi/deluge/plugins/__init__.py +++ b/deluge/plugins/WebUi/deluge/plugins/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/plugins/__init__.py b/deluge/plugins/__init__.py index 46dd0ac34..de40ea7ca 100644 --- a/deluge/plugins/__init__.py +++ b/deluge/plugins/__init__.py @@ -1,6 +1 @@ -from __future__ import unicode_literals - -# this is a namespace package -import pkg_resources - -pkg_resources.declare_namespace(__name__) +__import__('pkg_resources').declare_namespace(__name__) diff --git a/deluge/scripts/create_plugin.py b/deluge/scripts/create_plugin.py index aa58e3425..638c036db 100644 --- a/deluge/scripts/create_plugin.py +++ b/deluge/scripts/create_plugin.py @@ -388,9 +388,7 @@ GPL = """# """ -NAMESPACE_INIT = """# this is a namespace package -import pkg_resources -pkg_resources.declare_namespace(__name__) +NAMESPACE_INIT = """__import__('pkg_resources').declare_namespace(__name__) """ CREATE_DEV_LINK = """#!/bin/bash