[4220dd]: plugins / methodhelper.py Maximize Restore History

Download this file

methodhelper.py    23 lines (19 with data), 659 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
import __main__
class _MethodHelper(object):
__slots__ = ['root', 'name']
def __init__(self, root, name):
self.root = root
self.name = name
def __call__(self, event):
self.root._activity()
num, stc = self.root.getNumWin(event)
if stc.recording:
stc.macro.append((None, None, self.name))
if __main__.PRINTMACROS: print "recorded menu item", stc.macro[-1]
getattr(stc, self.name)(event)
class MethodHelper(object):
__slots__ = ['root']
def __init__(self, root):
self.root = root
def __getattr__(self, name):
return _MethodHelper(self.root, name)