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" __author_email__ = "andrew.resch@gmail.com"
__version__ = "1.0" __version__ = "1.0"
__url__ = "http://deluge-torrent.org" __url__ = "http://deluge-torrent.org"
__license__ = "GPL3" __license__ = "GPLv3"
__description__ = "Download and import IP blocklists" __description__ = "Download and import IP blocklists"
__long_description__ = __description__ __long_description__ = __description__
__pkg_data__ = {__plugin_name__.lower(): ["data/*"]} __pkg_data__ = {__plugin_name__.lower(): ["data/*"]}

View File

@ -28,7 +28,16 @@
# this exception statement from your version. If you delete this exception # this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here. # 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. Label plugin.
Offers filters on state,tracker and keyword. Offers filters on state,tracker and keyword.
@ -37,24 +46,27 @@ adds a tracker column.
future: Real labels. future: Real labels.
""" """
__pkg_data__ = {__plugin_name__.lower(): ["template/*", "data/*"]}
from setuptools import setup
__author__ = "Martijn Voncken <mvoncken@gmail.com>"
setup( setup(
name="Label", name=__plugin_name__,
version="0.1", version=__version__,
description=__doc__, description=__description__,
author=__author__, author=__author__,
packages=["label","label.gtkui","label.webui"], author_email=__author_email__,
package_data = {"label": ["template/*","data/*"]}, url=__url__,
license=__license__,
long_description=__long_description__,
packages=[__plugin_name__.lower()],
package_data = __pkg_data__,
entry_points=""" entry_points="""
[deluge.plugin.core] [deluge.plugin.core]
Label = label:CorePlugin %s = %s:CorePlugin
[deluge.plugin.webui]
Label = label:WebUIPlugin
[deluge.plugin.gtkui] [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 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( setup(
name="Stats", name=__plugin_name__,
version="0.1", version=__version__,
description=__doc__, description=__description__,
author=__author__, author=__author__,
packages=["stats"], author_email=__author_email__,
package_data = {"stats": ["template/*","data/*"]}, url=__url__,
license=__license__,
long_description=__long_description__,
packages=[__plugin_name__.lower()],
package_data = __pkg_data__,
entry_points=""" entry_points="""
[deluge.plugin.core] [deluge.plugin.core]
Stats = stats:CorePlugin %s = %s:CorePlugin
[deluge.plugin.webui]
Stats = stats:WebUIPlugin
[deluge.plugin.gtkui] [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("-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("-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("-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() (options, args) = parser.parse_args()
@ -33,6 +34,9 @@ def create_plugin():
print "--author-name is mandatory , use -h for more info" print "--author-name is mandatory , use -h for more info"
return return
if not options.url:
options.url = ""
if not os.path.exists(options.path): if not os.path.exists(options.path):
print "basepath does not exist" print "basepath does not exist"
return return
@ -54,6 +58,7 @@ def create_plugin():
"safe_name":safe_name, "safe_name":safe_name,
"filename":filename, "filename":filename,
"plugin_base":plugin_base, "plugin_base":plugin_base,
"url": options.url
} }
filename = os.path.join(path, filename) filename = os.path.join(path, filename)
@ -153,23 +158,37 @@ class GtkUIPlugin(PluginBase):
SETUP = """ SETUP = """
from setuptools import 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( setup(
name="%(name)s", name=__plugin_name__,
version="0.1", version=__version__,
description=__doc__, description=__description__,
author=__author__, author=__author__,
packages=["%(safe_name)s"], author_email=__author_email__,
package_data = {"%(safe_name)s": ["template/*","data/*"]}, url=__url__,
license=__license__,
long_description=__long_description__,
packages=[__plugin_name__.lower()],
package_data = __pkg_data__,
entry_points=\"\"\" entry_points=\"\"\"
[deluge.plugin.core] [deluge.plugin.core]
%(name)s = %(safe_name)s:CorePlugin %%s = %%s:CorePlugin
[deluge.plugin.webui]
%(name)s = %(safe_name)s:WebUIPlugin
[deluge.plugin.gtkui] [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() create_plugin()