4 def __init__(self, contexts = [ ], actions = { }, prio=0):
6 self.contexts = contexts
8 self.p = eActionMapPtr()
9 eActionMap.getInstance(self.p)
12 for ctx in self.contexts:
13 self.p.bindAction(ctx, self.prio, self.action)
16 for ctx in self.contexts:
17 self.p.unbindAction(ctx, self.action)
19 def action(self, context, action):
20 print " ".join(("action -> ", context, action))
21 if self.actions.has_key(action):
22 self.actions[action]()
24 print "unknown action %s/%s! typo in keymap?" % (context, action)