def cycle(self, argv):
        """cycle <range> <command> [<arg>...]
    Cycle the % variable through range, and re-evaluate the command for
    each value.
    Range is of the form [start':']end[':' step]
      Where start defaults to zero and step defaults to one.
    Or, range is a list of values separated by ','."""
        argv.pop(0) # eat name
        rangetoken = argv.pop(0)
        argv = self._expand_aliases(argv)
        meth = getattr(self, argv[0])
        for sloc, arg in enumerate(argv):
            if arg.find("%") >= 0:
                break
        else:
            self._ui.error("No %% substitution found.")
            return
        try:
            therange = self._parse_range(rangetoken)
        except __HOLE__, err:
            raise CLISyntaxError, err
        for i in therange:
            newargs = argv[:]
            newargs[sloc] = newargs[sloc].replace("%", str(i))
            self._ui.Print(" ".join(newargs))
            apply(meth, (newargs,))
dataset/ETHPy150Open kdart/pycopia/fepy/pycopia/fepy/CLI.py/BaseCommands.cycle