def __init__(self, headerList, ui): TreeSelector.__init__(self, TreeRoot(headerList), ui) # poor-man's multiple dispatch self.printersPre = { Category: self.printCategory, TryOption: self.printTryOption } self.printersPost = { } self.numTopStatusLines = 2 self.numBottomStatusLines = 3 self.numStatusLines = self.numTopStatusLines + self.numBottomStatusLines self.trySyntaxOverride = None
def handleKey(self, keyPressed, opts): if keyPressed in ["c"]: if self.confirmCommit(): return True elif keyPressed in ["e"]: self.trySyntaxOverride = self.inline_edit(self.bottomstatuswin, self.generateTrySyntax()).rstrip() return True else: return TreeSelector.handleKey(self, keyPressed, opts)