mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 03:55:43 +00:00
[Plugins] Update create_plugin script
* Tidyup copyright block
This commit is contained in:
parent
85364dc8ab
commit
7ad8431dd9
@ -1,11 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 GazpachoKing <chase.sterling@gmail.com>
|
|
||||||
#
|
|
||||||
# Basic plugin template created by:
|
# Basic plugin template created by:
|
||||||
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
||||||
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
# 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
||||||
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
|
# 2009 Damien Churchill <damoxc@gmail.com>
|
||||||
|
# 2010 Pedro Algarvio <pedro@algarvio.me>
|
||||||
|
# 2017 Calum Lind <calumlind+deluge@gmail.com>
|
||||||
#
|
#
|
||||||
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
# 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.
|
# the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
|
# Basic plugin template created by:
|
||||||
|
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
||||||
|
# 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
||||||
|
# 2009 Damien Churchill <damoxc@gmail.com>
|
||||||
|
# 2010 Pedro Algarvio <pedro@algarvio.me>
|
||||||
|
# 2017 Calum Lind <calumlind+deluge@gmail.com>
|
||||||
#
|
#
|
||||||
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
# 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.
|
# the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
|
# Basic plugin template created by:
|
||||||
|
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
||||||
|
# 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
||||||
|
# 2009 Damien Churchill <damoxc@gmail.com>
|
||||||
|
# 2010 Pedro Algarvio <pedro@algarvio.me>
|
||||||
|
# 2017 Calum Lind <calumlind+deluge@gmail.com>
|
||||||
#
|
#
|
||||||
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
# 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.
|
# the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
|
# Basic plugin template created by:
|
||||||
|
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
||||||
|
# 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
||||||
|
# 2009 Damien Churchill <damoxc@gmail.com>
|
||||||
|
# 2010 Pedro Algarvio <pedro@algarvio.me>
|
||||||
|
# 2017 Calum Lind <calumlind+deluge@gmail.com>
|
||||||
#
|
#
|
||||||
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
# 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.
|
# the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
|
# Basic plugin template created by:
|
||||||
|
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
||||||
|
# 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
||||||
|
# 2009 Damien Churchill <damoxc@gmail.com>
|
||||||
|
# 2010 Pedro Algarvio <pedro@algarvio.me>
|
||||||
|
# 2017 Calum Lind <calumlind+deluge@gmail.com>
|
||||||
#
|
#
|
||||||
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
# 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.
|
# the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
|
|
||||||
#
|
|
||||||
# Basic plugin template created by:
|
# Basic plugin template created by:
|
||||||
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
||||||
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
# 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
||||||
|
# 2009 Damien Churchill <damoxc@gmail.com>
|
||||||
|
# 2010 Pedro Algarvio <pedro@algarvio.me>
|
||||||
|
# 2017 Calum Lind <calumlind+deluge@gmail.com>
|
||||||
#
|
#
|
||||||
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
# 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.
|
# the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
|
# Basic plugin template created by:
|
||||||
|
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
||||||
|
# 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
||||||
|
# 2009 Damien Churchill <damoxc@gmail.com>
|
||||||
|
# 2010 Pedro Algarvio <pedro@algarvio.me>
|
||||||
|
# 2017 Calum Lind <calumlind+deluge@gmail.com>
|
||||||
#
|
#
|
||||||
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
# 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.
|
# the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010 John Garland <johnnybg+deluge@gmail.com>
|
|
||||||
#
|
|
||||||
# Basic plugin template created by:
|
# Basic plugin template created by:
|
||||||
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
||||||
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
# 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
||||||
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
|
# 2009 Damien Churchill <damoxc@gmail.com>
|
||||||
|
# 2010 Pedro Algarvio <pedro@algarvio.me>
|
||||||
|
# 2017 Calum Lind <calumlind+deluge@gmail.com>
|
||||||
#
|
#
|
||||||
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
# 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.
|
# the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
|
|
||||||
#
|
|
||||||
# Basic plugin template created by:
|
# Basic plugin template created by:
|
||||||
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
||||||
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
# 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
||||||
|
# 2009 Damien Churchill <damoxc@gmail.com>
|
||||||
|
# 2010 Pedro Algarvio <pedro@algarvio.me>
|
||||||
|
# 2017 Calum Lind <calumlind+deluge@gmail.com>
|
||||||
#
|
#
|
||||||
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
# 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.
|
# the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
|
@ -6,6 +6,7 @@ example:
|
|||||||
python create_plugin.py --name MyPlugin2 --basepath . --author-name "Your Name" --author-email "yourname@example.com"
|
python create_plugin.py --name MyPlugin2 --basepath . --author-name "Your Name" --author-email "yourname@example.com"
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function, unicode_literals
|
from __future__ import print_function, unicode_literals
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@ -107,17 +108,20 @@ def create_plugin():
|
|||||||
|
|
||||||
|
|
||||||
CORE = """
|
CORE = """
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from deluge.plugins.pluginbase import CorePluginBase
|
|
||||||
import deluge.configmanager
|
import deluge.configmanager
|
||||||
from deluge.core.rpcserver import export
|
from deluge.core.rpcserver import export
|
||||||
|
from deluge.plugins.pluginbase import CorePluginBase
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_PREFS = {
|
DEFAULT_PREFS = {
|
||||||
'test': 'NiNiNi'
|
'test': 'NiNiNi'
|
||||||
}
|
}
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class Core(CorePluginBase):
|
class Core(CorePluginBase):
|
||||||
def enable(self):
|
def enable(self):
|
||||||
@ -169,7 +173,7 @@ class WebUIPlugin(PluginInitBase):
|
|||||||
|
|
||||||
|
|
||||||
SETUP = """
|
SETUP = """
|
||||||
from setuptools import setup, find_packages
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
__plugin_name__ = '%(name)s'
|
__plugin_name__ = '%(name)s'
|
||||||
__author__ = '%(author_name)s'
|
__author__ = '%(author_name)s'
|
||||||
@ -189,7 +193,7 @@ setup(
|
|||||||
author_email=__author_email__,
|
author_email=__author_email__,
|
||||||
url=__url__,
|
url=__url__,
|
||||||
license=__license__,
|
license=__license__,
|
||||||
long_description=__long_description__ if __long_description__ else __description__,
|
long_description=__long_description__,
|
||||||
|
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
namespace_packages=['deluge', 'deluge.plugins'],
|
namespace_packages=['deluge', 'deluge.plugins'],
|
||||||
@ -197,17 +201,16 @@ setup(
|
|||||||
|
|
||||||
entry_points=\"\"\"
|
entry_points=\"\"\"
|
||||||
[deluge.plugin.core]
|
[deluge.plugin.core]
|
||||||
%%(plugin_name)s = deluge.plugins.%%(plugin_module)s:CorePlugin
|
%%s = deluge.plugins.%%s:CorePlugin
|
||||||
[deluge.plugin.gtkui]
|
[deluge.plugin.gtkui]
|
||||||
%%(plugin_name)s = deluge.plugins.%%(plugin_module)s:GtkUIPlugin
|
%%s = deluge.plugins.%%s:GtkUIPlugin
|
||||||
[deluge.plugin.web]
|
[deluge.plugin.web]
|
||||||
%%(plugin_name)s = deluge.plugins.%%(plugin_module)s:WebUIPlugin
|
%%s = deluge.plugins.%%s:WebUIPlugin
|
||||||
\"\"\" %% dict(plugin_name=__plugin_name__, plugin_module=__plugin_name__.lower())
|
\"\"\" %% ((__plugin_name__, __plugin_name__.lower()) * 3)
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
COMMON = """
|
COMMON = """
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
@ -223,12 +226,14 @@ def get_resource(filename):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
GTKUI = """
|
GTKUI = """
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from deluge.ui.client import client
|
|
||||||
from deluge.plugins.pluginbase import GtkPluginBase
|
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
|
from deluge.plugins.pluginbase import GtkPluginBase
|
||||||
|
from deluge.ui.client import client
|
||||||
|
|
||||||
from .common import get_resource
|
from .common import get_resource
|
||||||
|
|
||||||
@ -293,9 +298,12 @@ GLADE = """<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
WEBUI = """
|
WEBUI = """
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from deluge.ui.client import client
|
|
||||||
from deluge.plugins.pluginbase import WebPluginBase
|
from deluge.plugins.pluginbase import WebPluginBase
|
||||||
|
from deluge.ui.client import client
|
||||||
|
|
||||||
from .common import get_resource
|
from .common import get_resource
|
||||||
|
|
||||||
@ -334,11 +342,11 @@ Copyright:
|
|||||||
},
|
},
|
||||||
|
|
||||||
onDisable: function() {
|
onDisable: function() {
|
||||||
|
deluge.preferences.removePage(this.prefsPage);
|
||||||
},
|
},
|
||||||
|
|
||||||
onEnable: function() {
|
onEnable: function() {
|
||||||
|
this.prefsPage = deluge.preferences.addPage(new Deluge.ux.preferences.%(name)sPage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
new %(name)sPlugin();
|
new %(name)sPlugin();
|
||||||
@ -351,14 +359,16 @@ GPL = """#
|
|||||||
#
|
#
|
||||||
# Basic plugin template created by:
|
# Basic plugin template created by:
|
||||||
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
|
||||||
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
# 2007-2009 Andrew Resch <andrewresch@gmail.com>
|
||||||
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
|
# 2009 Damien Churchill <damoxc@gmail.com>
|
||||||
# Copyright (C) 2010 Pedro Algarvio <pedro@algarvio.me>
|
# 2010 Pedro Algarvio <pedro@algarvio.me>
|
||||||
|
# 2017 Calum Lind <calumlind+deluge@gmail.com>
|
||||||
#
|
#
|
||||||
# This file is part of %(name)s and is licensed under GNU General Public License 3.0, or later, with
|
# 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.
|
# the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
# See LICENSE for more details.
|
# See LICENSE for more details.
|
||||||
#
|
#
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
NAMESPACE_INIT = """# this is a namespace package
|
NAMESPACE_INIT = """# this is a namespace package
|
||||||
|
Loading…
x
Reference in New Issue
Block a user