GnuCash
2.6.99
|
Public Member Functions | |
def | __new__ |
def | __init__ |
def | get_instance |
def | add_method |
def | ya_add_classmethod |
def | ya_add_method |
def | add_methods_with_prefix |
def | add_constructor_and_methods_with_prefix |
def | decorate_functions |
Properties | |
instance = property(get_instance) | |
Inherit this class to give yourself a python class that wraps a set of functions that together constitute the methods of the class. The method functions must all have as a first argument an object holding the instance data. There must also be a function that returns a new instance of the class, the constructor. Your subclass must define _module - The module where the method functions, including the constructor can be found _new_instance - The name of a function that serves as a constructor, returning the instance data. To access the instance data, use the read-only property instance. To add some functions from _module as methods, call classmethods like add_method and add_methods_with_prefix.
Definition at line 31 of file function_class.py.
def python-bindings.function_class.ClassFromFunctions.__init__ | ( | self, | |
args, | |||
kargs | |||
) |
Construct a new instance, using either the function self._module[self._new_instance] or using existing instance data. (specified with the keyword argument, instance) Pass the arguments that should be passed on to self._module[self._new_instance] . Any arguments of that are instances of ClassFromFunctions will be switched with the instance data. (by calling the .instance property)
Definition at line 57 of file function_class.py.
def python-bindings.function_class.ClassFromFunctions.add_constructor_and_methods_with_prefix | ( | cls, | |
prefix, | |||
constructor | |||
) |
Add a group of functions with the same prefix, and set the _new_instance attribute to prefix + constructor
Definition at line 136 of file function_class.py.
def python-bindings.function_class.ClassFromFunctions.add_method | ( | cls, | |
function_name, | |||
method_name | |||
) |
Add the function, method_name to this class as a method named name
Definition at line 85 of file function_class.py.
def python-bindings.function_class.ClassFromFunctions.add_methods_with_prefix | ( | cls, | |
prefix | |||
) |
Add a group of functions with the same prefix
Definition at line 128 of file function_class.py.
def python-bindings.function_class.ClassFromFunctions.get_instance | ( | self | ) |
Get the instance data. You can also call the instance property
Definition at line 73 of file function_class.py.
def python-bindings.function_class.ClassFromFunctions.ya_add_classmethod | ( | cls, | |
function_name, | |||
method_name | |||
) |
Add the function, method_name to this class as a classmethod named name Taken from function_class and slightly modified.
Definition at line 98 of file function_class.py.
def python-bindings.function_class.ClassFromFunctions.ya_add_method | ( | cls, | |
function_name, | |||
method_name | |||
) |
Add the function, method_name to this class as a method named name Taken from function_class and slightly modified.
Definition at line 113 of file function_class.py.