def subOp(self, opName): op = OperationRegistry.getRegisteredOp(opName); if op == None: print "ERROR: subOp called with unknown op \"%s\"" % opName; op.subSelf(self);
def subOp(self, opName): op = OperationRegistry.getRegisteredOp(opName) if op == None: print "ERROR: subOp called with unknown op \"%s\"" % opName op.subSelf(self)
def printOpList(opList, indent): opList.sort(key=lambda op : op.getName().lower()); for op in opList: if isinstance(op, GroupingOperation): opNameList = op.getOpNameList(); subOpList = [OperationRegistry.getRegisteredOp(subOp) for subOp in opNameList]; print indent * " " + "\"" + op.getName() + "\" <group>:"; printOpList(subOpList, indent + 2); else: print indent * " " + "\"" + op.getName() + "\"";
def printOpList(opList, indent): opList.sort(key=lambda op: op.getName().lower()) for op in opList: if isinstance(op, GroupingOperation): opNameList = op.getOpNameList() subOpList = [ OperationRegistry.getRegisteredOp(subOp) for subOp in opNameList ] print indent * " " + "\"" + op.getName() + "\" <group>:" printOpList(subOpList, indent + 2) else: print indent * " " + "\"" + op.getName() + "\""
def showOpsCallback(option, opt, value, parser, *args): """ Callback that prints the names of all registered operations. """ ## begin local function for recursion def printOpList(opList, indent): opList.sort(key=lambda op : op.getName().lower()); for op in opList: if isinstance(op, GroupingOperation): opNameList = op.getOpNameList(); subOpList = [OperationRegistry.getRegisteredOp(subOp) for subOp in opNameList]; print indent * " " + "\"" + op.getName() + "\" <group>:"; printOpList(subOpList, indent + 2); else: print indent * " " + "\"" + op.getName() + "\""; print "Registered operations are:"; ## end local function printOpList(OperationRegistry.getRegisteredOpList(), 2); sys.exit(0);
def showOpsCallback(option, opt, value, parser, *args): """ Callback that prints the names of all registered operations. """ ## begin local function for recursion def printOpList(opList, indent): opList.sort(key=lambda op: op.getName().lower()) for op in opList: if isinstance(op, GroupingOperation): opNameList = op.getOpNameList() subOpList = [ OperationRegistry.getRegisteredOp(subOp) for subOp in opNameList ] print indent * " " + "\"" + op.getName() + "\" <group>:" printOpList(subOpList, indent + 2) else: print indent * " " + "\"" + op.getName() + "\"" print "Registered operations are:" ## end local function printOpList(OperationRegistry.getRegisteredOpList(), 2) sys.exit(0)