pycrossword
0.3
Pure-Python implementation of a crossword puzzle generator and editor
|
Classes | |
class | PxPluginBase |
Base class for category-specific user plugins (extensions) written in Python. More... | |
class | PxPluginGeneral |
Base class General user plugins (placed in the 'general' category). More... | |
Functions | |
def | before (func) |
Decorator adds the wraptype attribute set to 'before' to a given function. More... | |
def | after (func) |
Decorator adds the wraptype attribute set to 'after' to a given function. More... | |
def | replace (func) |
Decorator adds the wraptype attribute set to 'replace' to a given function. More... | |
def pycross.utils.pluginbase.after | ( | func | ) |
def pycross.utils.pluginbase.before | ( | func | ) |
Decorator adds the wraptype
attribute set to 'before' to a given function.
Use this decorator for plugin methods that override those of pycross::gui::MainWindow. The before
decorator will make the app first call the plugin method, then the original one. For example:
With this code (provided that the plugin is active), when the user triggers the act_new
action of the main window, the app will first call the plugin method and print 'hey!', then proceed with the original method handler (on_act_new
).
Note that when using before
, the result returned will be that of the original function, since it will be called last.
def pycross.utils.pluginbase.replace | ( | func | ) |