mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
plugin api update
This commit is contained in:
parent
c54d87b69c
commit
ca69c978a7
7 changed files with 15 additions and 29 deletions
|
@ -94,11 +94,8 @@ class plugin_Example: # The plugin's class
|
||||||
|
|
||||||
register_plugin("Example Plugin", # The name of the plugin
|
register_plugin("Example Plugin", # The name of the plugin
|
||||||
plugin_Example, # The plugin's class
|
plugin_Example, # The plugin's class
|
||||||
|
"Zach Tibbitts", # The author's Name
|
||||||
"0.5.0", # The plugin's version number
|
"0.5.0", # The plugin's version number
|
||||||
"An example plugin", # A description of the plugin
|
"An example plugin", # A description of the plugin
|
||||||
config=True, # If the plugin can be configured
|
config=True, # If the plugin can be configured
|
||||||
default=False, # If the plugin should be loaded by default
|
|
||||||
requires="0.5.0", # Required version of Deluge
|
|
||||||
interface="gtk", # Required Deluge interface
|
|
||||||
required_plugins=None # Any plugins that must be loaded before this
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -14,6 +14,6 @@ class plugin_Hello:
|
||||||
|
|
||||||
register_plugin("Hello World",
|
register_plugin("Hello World",
|
||||||
plugin_Hello,
|
plugin_Hello,
|
||||||
|
"Zach Tibbitts",
|
||||||
"1.0",
|
"1.0",
|
||||||
'Displays "Hello, World"',
|
'Displays "Hello, World"')
|
||||||
requires="0.5.0")
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ class plugin_NetGraph:
|
||||||
|
|
||||||
self.parentNotebook = self.parent.notebook
|
self.parentNotebook = self.parent.notebook
|
||||||
# print "Parent NOTEBOOK:", self.parentNotebook
|
# print "Parent NOTEBOOK:", self.parentNotebook
|
||||||
self.parentNotebook.append_page(self.topWidget, gtk.Label("NetGraph"))
|
self.parentNotebook.append_page(self.topWidget, gtk.Label("Graph"))
|
||||||
# print "My INDEX in parentNoteBook:", self.index
|
# print "My INDEX in parentNoteBook:", self.index
|
||||||
|
|
||||||
self.image.show()
|
self.image.show()
|
||||||
|
@ -162,11 +162,8 @@ class plugin_NetGraph:
|
||||||
|
|
||||||
register_plugin("Network Activity Graph", # The name of the plugin
|
register_plugin("Network Activity Graph", # The name of the plugin
|
||||||
plugin_NetGraph, # The plugin's class
|
plugin_NetGraph, # The plugin's class
|
||||||
|
"Alon Zakai, Zach Tibbitts", # Authors
|
||||||
"0.2", # The plugin's version number
|
"0.2", # The plugin's version number
|
||||||
"Network Activity Graph plugin\n\nWritten by Kripkenstein", # A description of the plugin
|
"Network Activity Graph plugin\n\nWritten by Kripkenstein", # A description of the plugin
|
||||||
config=False, # If the plugin can be configured
|
config=False, # If the plugin can be configured
|
||||||
default=False, # If the plugin should be loaded by default
|
|
||||||
requires="0.5.0", # Required version of Deluge
|
|
||||||
interface="gtk", # Required Deluge interface
|
|
||||||
required_plugins=None # Any plugins that must be loaded before this
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -32,11 +32,8 @@ class plugin_NetworkHealth:
|
||||||
### Register plugin with Deluge
|
### Register plugin with Deluge
|
||||||
register_plugin("Network Health Monitor", # The name of the plugin
|
register_plugin("Network Health Monitor", # The name of the plugin
|
||||||
plugin_NetworkHealth, # The plugin's class
|
plugin_NetworkHealth, # The plugin's class
|
||||||
|
"Alon Zakai, Zach Tibbitts", # Authors
|
||||||
"0.2", # The plugin's version number
|
"0.2", # The plugin's version number
|
||||||
"Network Health Monitor plugin\n\nWritten by Kripkenstein", # A description of the plugin
|
"Network Health Monitor plugin\n\nWritten by Kripkenstein", # A description of the plugin
|
||||||
config=False, # If the plugin can be configured
|
config=False # If the plugin can be configured\
|
||||||
default=False, # If the plugin should be loaded by default
|
|
||||||
requires="0.5.0", # Required version of Deluge
|
|
||||||
interface="gtk", # Required Deluge interface
|
|
||||||
required_plugins=None # Any plugins that must be loaded before this
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -154,10 +154,8 @@ class plugin_Search:
|
||||||
|
|
||||||
register_plugin("Torrent Search",
|
register_plugin("Torrent Search",
|
||||||
plugin_Search,
|
plugin_Search,
|
||||||
|
"Zach Tibbitts",
|
||||||
"0.5",
|
"0.5",
|
||||||
"A searchbar for torrent search engines",
|
"A searchbar for torrent search engines",
|
||||||
config=True,
|
config=True
|
||||||
default=False,
|
)
|
||||||
requires="0.5.0",
|
|
||||||
interface="gtk",
|
|
||||||
required_plugins=None)
|
|
||||||
|
|
|
@ -261,6 +261,7 @@ class DelugeGTK:
|
||||||
return True
|
return True
|
||||||
name = model.get_value(model.get_iter(path), 0)
|
name = model.get_value(model.get_iter(path), 0)
|
||||||
plugin = self.plugins.get_plugin(name)
|
plugin = self.plugins.get_plugin(name)
|
||||||
|
author = plugin['author']
|
||||||
version = plugin['version']
|
version = plugin['version']
|
||||||
config = plugin['config']
|
config = plugin['config']
|
||||||
description = plugin['description']
|
description = plugin['description']
|
||||||
|
@ -269,8 +270,8 @@ class DelugeGTK:
|
||||||
else:
|
else:
|
||||||
self.prf_glade.get_widget("plugin_conf").set_sensitive(False)
|
self.prf_glade.get_widget("plugin_conf").set_sensitive(False)
|
||||||
self.prf_glade.get_widget("plugin_text").get_buffer(
|
self.prf_glade.get_widget("plugin_text").get_buffer(
|
||||||
).set_text("%s\nVersion: %s\n\n%s"%
|
).set_text("%s\nBy: %s\nVersion: %s\n\n%s"%
|
||||||
(name, version, description))
|
(name, author, version, description))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def plugin_toggled(self, renderer, path):
|
def plugin_toggled(self, renderer, path):
|
||||||
|
|
|
@ -71,16 +71,12 @@ class PluginManager:
|
||||||
self.enabled_plugins[name].unload()
|
self.enabled_plugins[name].unload()
|
||||||
self.enabled_plugins.clear()
|
self.enabled_plugins.clear()
|
||||||
|
|
||||||
def register_plugin(self, name, plugin_class, version, description, config=False,
|
def register_plugin(self, name, plugin_class, author, version, description, config=False):
|
||||||
default=False, requires=None, interface=None, required_plugins=None):
|
|
||||||
self.available_plugins[name] = {'class': plugin_class,
|
self.available_plugins[name] = {'class': plugin_class,
|
||||||
|
'author': author,
|
||||||
'version': version,
|
'version': version,
|
||||||
'description': description,
|
'description': description,
|
||||||
'config': config,
|
'config': config,
|
||||||
'default': default,
|
|
||||||
'requires': requires,
|
|
||||||
'interface': interface,
|
|
||||||
'req plugins': required_plugins,
|
|
||||||
'path': self.path}
|
'path': self.path}
|
||||||
|
|
||||||
## Few lines of code to test functionality
|
## Few lines of code to test functionality
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue