コード例 #1
0
ファイル: weaver.py プロジェクト: baris/pyaspects
def weave_all_methods(aspect, class_or_object):

    p = PointCut()
    _dict = dict(inspect.getmembers(class_or_object, inspect.ismethod))
    for met_name in _dict:
        if not met_name.startswith("__"):
            p.addMethod(class_or_object, met_name)

    aspect.updatePointCut(p)
    for met_name in _dict:
        if not met_name.startswith("__"):
            __weave_method(aspect, class_or_object, met_name)
コード例 #2
0
def weave_all_methods(aspect, class_or_object):

    p = PointCut()
    _dict = dict(inspect.getmembers(class_or_object, inspect.ismethod))
    for met_name in _dict:
        if not met_name.startswith('__'):
            p.addMethod(class_or_object, met_name)

    aspect.updatePointCut(p)
    for met_name in _dict:
        if not met_name.startswith('__'):
            __weave_method(aspect, class_or_object, met_name)
コード例 #3
0
ファイル: weaver.py プロジェクト: baris/pyaspects
def weave_method(aspect, class_or_object, met_name):
    p = PointCut()
    p.addMethod(class_or_object, met_name)
    aspect.updatePointCut(p)
    __weave_method(aspect, class_or_object, met_name)
コード例 #4
0
def weave_method(aspect, class_or_object, met_name):
    p = PointCut()
    p.addMethod(class_or_object, met_name)
    aspect.updatePointCut(p)
    __weave_method(aspect, class_or_object, met_name)