コード例 #1
0
 def subOp(self, opName):
     op = OperationRegistry.getRegisteredOp(opName);
     
     if op == None:
         print "ERROR: subOp called with unknown op \"%s\"" % opName;
     
     op.subSelf(self);
コード例 #2
0
    def subOp(self, opName):
        op = OperationRegistry.getRegisteredOp(opName)

        if op == None:
            print "ERROR: subOp called with unknown op \"%s\"" % opName

        op.subSelf(self)
コード例 #3
0
 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() + "\"";
コード例 #4
0
 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() + "\""
コード例 #5
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);
コード例 #6
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)