Convert plugins setup.py to new format

Update create_plugin script to use new setup.py format
This commit is contained in:
Andrew Resch 2008-10-27 03:53:21 +00:00
parent edaf3da0fc
commit ac9959a92b
4 changed files with 83 additions and 42 deletions

View File

@ -35,7 +35,7 @@ __author__ = "Andrew Resch"
__author_email__ = "andrew.resch@gmail.com"
__version__ = "1.0"
__url__ = "http://deluge-torrent.org"
__license__ = "GPL3"
__license__ = "GPLv3"
__description__ = "Download and import IP blocklists"
__long_description__ = __description__
__pkg_data__ = {__plugin_name__.lower(): ["data/*"]}

View File

@ -28,7 +28,16 @@
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
"""
from setuptools import setup
__plugin_name__ = "Label"
__author__ = "Martijn Voncken"
__author_email__ = "mvoncken@gmail.com"
__version__ = "0.1"
__url__ = "http://deluge-torrent.org"
__license__ = "GPLv3"
__description__ = "Label plugin."
__long_description__ = """
Label plugin.
Offers filters on state,tracker and keyword.
@ -37,24 +46,27 @@ adds a tracker column.
future: Real labels.
"""
from setuptools import setup
__author__ = "Martijn Voncken <mvoncken@gmail.com>"
__pkg_data__ = {__plugin_name__.lower(): ["template/*", "data/*"]}
setup(
name="Label",
version="0.1",
description=__doc__,
name=__plugin_name__,
version=__version__,
description=__description__,
author=__author__,
packages=["label","label.gtkui","label.webui"],
package_data = {"label": ["template/*","data/*"]},
author_email=__author_email__,
url=__url__,
license=__license__,
long_description=__long_description__,
packages=[__plugin_name__.lower()],
package_data = __pkg_data__,
entry_points="""
[deluge.plugin.core]
Label = label:CorePlugin
[deluge.plugin.webui]
Label = label:WebUIPlugin
%s = %s:CorePlugin
[deluge.plugin.gtkui]
Label = label:GtkUIPlugin
"""
%s = %s:GtkUIPlugin
[deluge.plugin.webui]
%s = %s:WebUIPlugin
""" % ((__plugin_name__, __plugin_name__.lower())*3)
)

View File

@ -36,21 +36,35 @@
from setuptools import setup
__author__ = "Martijn Voncken <mvoncken@gmail.com>"
__plugin_name__ = "Stats"
__author__ = "Martijn Voncken"
__author_email__ = "mvoncken@gmail.com"
__version__ = "0.1"
__url__ = "http://deluge-torrent.org"
__license__ = "GPLv3"
__description__ = ""
__long_description__ = """"""
__pkg_data__ = {__plugin_name__.lower(): ["template/*", "data/*"]}
setup(
name="Stats",
version="0.1",
description=__doc__,
name=__plugin_name__,
version=__version__,
description=__description__,
author=__author__,
packages=["stats"],
package_data = {"stats": ["template/*","data/*"]},
author_email=__author_email__,
url=__url__,
license=__license__,
long_description=__long_description__,
packages=[__plugin_name__.lower()],
package_data = __pkg_data__,
entry_points="""
[deluge.plugin.core]
Stats = stats:CorePlugin
[deluge.plugin.webui]
Stats = stats:WebUIPlugin
%s = %s:CorePlugin
[deluge.plugin.gtkui]
Stats = stats:GtkUIPlugin
"""
%s = %s:GtkUIPlugin
[deluge.plugin.webui]
%s = %s:WebUIPlugin
""" % ((__plugin_name__, __plugin_name__.lower())*3)
)

View File

@ -14,6 +14,7 @@ parser.add_option("-n", "--name", dest="name",help="plugin name")
parser.add_option("-p", "--basepath", dest="path",help="base path")
parser.add_option("-a", "--author-name", dest="author_name",help="author name,for the GPL header")
parser.add_option("-e", "--author-email", dest="author_email",help="author email,for the GPL header")
parser.add_option("-u", "--url", dest="url", help="Homepage URL")
(options, args) = parser.parse_args()
@ -33,6 +34,9 @@ def create_plugin():
print "--author-name is mandatory , use -h for more info"
return
if not options.url:
options.url = ""
if not os.path.exists(options.path):
print "basepath does not exist"
return
@ -54,6 +58,7 @@ def create_plugin():
"safe_name":safe_name,
"filename":filename,
"plugin_base":plugin_base,
"url": options.url
}
filename = os.path.join(path, filename)
@ -153,23 +158,37 @@ class GtkUIPlugin(PluginBase):
SETUP = """
from setuptools import setup
__author__ = "%(author_name)s <%(author_email)s>"
__plugin_name__ = "%(name)s"
__author__ = "%(author_name)s"
__author_email__ = "%(author_email)s"
__version__ = "0.1"
__url__ = "%(url)s"
__license__ = "GPLv3"
__description__ = ""
__long_description__ = \"\"\"\"\"\"
__pkg_data__ = {__plugin_name__.lower(): ["template/*", "data/*"]}
setup(
name="%(name)s",
version="0.1",
description=__doc__,
name=__plugin_name__,
version=__version__,
description=__description__,
author=__author__,
packages=["%(safe_name)s"],
package_data = {"%(safe_name)s": ["template/*","data/*"]},
author_email=__author_email__,
url=__url__,
license=__license__,
long_description=__long_description__,
packages=[__plugin_name__.lower()],
package_data = __pkg_data__,
entry_points=\"\"\"
[deluge.plugin.core]
%(name)s = %(safe_name)s:CorePlugin
[deluge.plugin.webui]
%(name)s = %(safe_name)s:WebUIPlugin
%%s = %%s:CorePlugin
[deluge.plugin.gtkui]
%(name)s = %(safe_name)s:GtkUIPlugin
\"\"\"
%%s = %%s:GtkUIPlugin
[deluge.plugin.webui]
%%s = %%s:WebUIPlugin
\"\"\" %% ((__plugin_name__, __plugin_name__.lower())*3)
)
"""
@ -344,7 +363,3 @@ rm -fr ./temp
"""
create_plugin()