-
-
Notifications
You must be signed in to change notification settings - Fork 768
Expand file tree
/
Copy pathmotion_decorator.py
More file actions
37 lines (30 loc) · 704 Bytes
/
motion_decorator.py
File metadata and controls
37 lines (30 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!coding=utf-8
"""
to test pymode motions, please put cursor on each of the lines
and press "vaM" for selecting methods or
"vaC" for selection class.
"""
def a_decorator(func):
print("chamando func")
def wrapped(*args, **kw):
return func(*args, **kw)
print("Pós func")
return wrapped
def b_decorator(func):
print("second chamando func")
def wrapped(*args, **kw):
return func(*args, **kw)
print("second Pós func")
return wrapped
@b_decorator
@a_decorator
def teste():
print("Not Selecting Decorator")
class Teste:
@a_decorator
@b_decorator
def metodo(self):
print("Meu método")
teste()
testinho = Teste()
testinho.metodo()