A set of decorator functions designed to make building a plugin or extending lib.browser.plugins.Pluggable a snap. If you’re writing either, this is the API you’ll probably work with the most.
When given a function, adds an attribute to the function, is_override. An overriding function should take 3 arguments, self (or plugin), browser, and an argument representing the function they are overriding.
@override
def load_page(plugin, browser, old_function, *args, **kwargs):
# do something here
return old_function(*args, **kwargs)
When given a function, adds an attribute to the function, is_extension. An extending function should take 2 arguments, self (or plugin) and browser.
@extension
def new_functionality(plugin, browser, first_argument, second_argument):
# do something here
pass
When given a function, adds an attribute to the function, is_property_extension. The function should take 2 arguments, self (or plugin) and browser. It should return an instance of property.
@property_extension
def tribbles_count(plugin, browser):
number = 9001
def getter():
return number
def setter(value):
assert value > 9000
number = value
return property(getter, setter)
A decorator which makes the passed function a handler for an attribute type with it’s name. A handler should take both name and value arguments, or just a value argument if the plugin’s attribute is just a list.
A decorator factory, allowing you to set multiple handler functions for the same attribute type. A handler should take both name and value arguments, or just a value argument if the plugin’s attribute is just a list.
1.2.2.1. The Plugin Architechure
1.2.2.3. redirect – Base Plugin Class for Handling Redirections
Enter search terms or a module, class or function name.