diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/common.py b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/common.py index 863d73455..79d152e9a 100644 --- a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/common.py +++ b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/common.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2009 GazpachoKing -# # Basic plugin template created by: # Copyright (C) 2008 Martijn Voncken -# Copyright (C) 2007-2009 Andrew Resch -# Copyright (C) 2009 Damien Churchill +# 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. diff --git a/deluge/plugins/Blocklist/deluge/plugins/blocklist/common.py b/deluge/plugins/Blocklist/deluge/plugins/blocklist/common.py index f112dda95..b53ed2605 100644 --- a/deluge/plugins/Blocklist/deluge/plugins/blocklist/common.py +++ b/deluge/plugins/Blocklist/deluge/plugins/blocklist/common.py @@ -1,6 +1,11 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2009 Andrew Resch +# 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. diff --git a/deluge/plugins/Execute/deluge/plugins/execute/common.py b/deluge/plugins/Execute/deluge/plugins/execute/common.py index 3977edd3b..79d152e9a 100644 --- a/deluge/plugins/Execute/deluge/plugins/execute/common.py +++ b/deluge/plugins/Execute/deluge/plugins/execute/common.py @@ -1,6 +1,11 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2009 Andrew Resch +# 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. diff --git a/deluge/plugins/Extractor/deluge/plugins/extractor/common.py b/deluge/plugins/Extractor/deluge/plugins/extractor/common.py index 3977edd3b..79d152e9a 100644 --- a/deluge/plugins/Extractor/deluge/plugins/extractor/common.py +++ b/deluge/plugins/Extractor/deluge/plugins/extractor/common.py @@ -1,6 +1,11 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2009 Andrew Resch +# 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. diff --git a/deluge/plugins/Label/deluge/plugins/label/common.py b/deluge/plugins/Label/deluge/plugins/label/common.py index 3977edd3b..79d152e9a 100644 --- a/deluge/plugins/Label/deluge/plugins/label/common.py +++ b/deluge/plugins/Label/deluge/plugins/label/common.py @@ -1,6 +1,11 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2009 Andrew Resch +# 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. diff --git a/deluge/plugins/Scheduler/deluge/plugins/scheduler/common.py b/deluge/plugins/Scheduler/deluge/plugins/scheduler/common.py index f6251de13..79d152e9a 100644 --- a/deluge/plugins/Scheduler/deluge/plugins/scheduler/common.py +++ b/deluge/plugins/Scheduler/deluge/plugins/scheduler/common.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2009 Andrew Resch -# # Basic plugin template created by: # Copyright (C) 2008 Martijn Voncken -# Copyright (C) 2007-2009 Andrew Resch +# 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. diff --git a/deluge/plugins/Stats/deluge/plugins/stats/common.py b/deluge/plugins/Stats/deluge/plugins/stats/common.py index 3977edd3b..79d152e9a 100644 --- a/deluge/plugins/Stats/deluge/plugins/stats/common.py +++ b/deluge/plugins/Stats/deluge/plugins/stats/common.py @@ -1,6 +1,11 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2009 Andrew Resch +# 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. diff --git a/deluge/plugins/Toggle/deluge/plugins/toggle/common.py b/deluge/plugins/Toggle/deluge/plugins/toggle/common.py index d958ec1df..79d152e9a 100644 --- a/deluge/plugins/Toggle/deluge/plugins/toggle/common.py +++ b/deluge/plugins/Toggle/deluge/plugins/toggle/common.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2010 John Garland -# # Basic plugin template created by: # Copyright (C) 2008 Martijn Voncken -# Copyright (C) 2007-2009 Andrew Resch -# Copyright (C) 2009 Damien Churchill +# 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. diff --git a/deluge/plugins/WebUi/deluge/plugins/webui/common.py b/deluge/plugins/WebUi/deluge/plugins/webui/common.py index 10b97387d..79d152e9a 100644 --- a/deluge/plugins/WebUi/deluge/plugins/webui/common.py +++ b/deluge/plugins/WebUi/deluge/plugins/webui/common.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2009 Damien Churchill -# # Basic plugin template created by: # Copyright (C) 2008 Martijn Voncken -# Copyright (C) 2007-2009 Andrew Resch +# 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. diff --git a/deluge/scripts/create_plugin.py b/deluge/scripts/create_plugin.py index 447cc5da6..c66aba441 100644 --- a/deluge/scripts/create_plugin.py +++ b/deluge/scripts/create_plugin.py @@ -6,6 +6,7 @@ example: python create_plugin.py --name MyPlugin2 --basepath . --author-name "Your Name" --author-email "yourname@example.com" """ + from __future__ import print_function, unicode_literals import os @@ -107,17 +108,20 @@ def create_plugin(): CORE = """ +from __future__ import unicode_literals + import logging -from deluge.plugins.pluginbase import CorePluginBase + import deluge.configmanager from deluge.core.rpcserver import export +from deluge.plugins.pluginbase import CorePluginBase + +log = logging.getLogger(__name__) DEFAULT_PREFS = { 'test': 'NiNiNi' } -log = logging.getLogger(__name__) - class Core(CorePluginBase): def enable(self): @@ -169,7 +173,7 @@ class WebUIPlugin(PluginInitBase): SETUP = """ -from setuptools import setup, find_packages +from setuptools import find_packages, setup __plugin_name__ = '%(name)s' __author__ = '%(author_name)s' @@ -189,7 +193,7 @@ setup( author_email=__author_email__, url=__url__, license=__license__, - long_description=__long_description__ if __long_description__ else __description__, + long_description=__long_description__, packages=find_packages(), namespace_packages=['deluge', 'deluge.plugins'], @@ -197,17 +201,16 @@ setup( entry_points=\"\"\" [deluge.plugin.core] - %%(plugin_name)s = deluge.plugins.%%(plugin_module)s:CorePlugin + %%s = deluge.plugins.%%s:CorePlugin [deluge.plugin.gtkui] - %%(plugin_name)s = deluge.plugins.%%(plugin_module)s:GtkUIPlugin + %%s = deluge.plugins.%%s:GtkUIPlugin [deluge.plugin.web] - %%(plugin_name)s = deluge.plugins.%%(plugin_module)s:WebUIPlugin - \"\"\" %% dict(plugin_name=__plugin_name__, plugin_module=__plugin_name__.lower()) + %%s = deluge.plugins.%%s:WebUIPlugin + \"\"\" %% ((__plugin_name__, __plugin_name__.lower()) * 3) ) """ COMMON = """ - from __future__ import unicode_literals import os.path @@ -223,12 +226,14 @@ def get_resource(filename): """ GTKUI = """ +from __future__ import unicode_literals + import gtk import logging -from deluge.ui.client import client -from deluge.plugins.pluginbase import GtkPluginBase import deluge.component as component +from deluge.plugins.pluginbase import GtkPluginBase +from deluge.ui.client import client from .common import get_resource @@ -293,9 +298,12 @@ GLADE = """ """ WEBUI = """ +from __future__ import unicode_literals + import logging -from deluge.ui.client import client + from deluge.plugins.pluginbase import WebPluginBase +from deluge.ui.client import client from .common import get_resource @@ -334,11 +342,11 @@ Copyright: }, onDisable: function() { - + deluge.preferences.removePage(this.prefsPage); }, onEnable: function() { - + this.prefsPage = deluge.preferences.addPage(new Deluge.ux.preferences.%(name)sPage()); } }); new %(name)sPlugin(); @@ -351,14 +359,16 @@ GPL = """# # # Basic plugin template created by: # Copyright (C) 2008 Martijn Voncken -# Copyright (C) 2007-2009 Andrew Resch -# Copyright (C) 2009 Damien Churchill -# Copyright (C) 2010 Pedro Algarvio +# 2007-2009 Andrew Resch +# 2009 Damien Churchill +# 2010 Pedro Algarvio +# 2017 Calum Lind # # This file is part of %(name)s 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. # + """ NAMESPACE_INIT = """# this is a namespace package