trepan/processor/cmdproc.py
def get_int(self, arg, min_value=0, default=1, cmdname=None,
                at_most=None):
        """If no argument use the default. If arg is a an integer between
        least min_value and at_most, use that. Otherwise report an error.
        If there's a stack frame use that in evaluation."""

        if arg is None: return default
        default = self.get_int_noerr(arg)
        if default is None:
            if cmdname:
                self.errmsg(("Command '%s' expects an integer; "
                             + "got: %s.") % (cmdname, str(arg)))
            else:
                self.errmsg('Expecting a positive integer, got: %s'
                            % str(arg))
                pass
            return None
            pass
        if default < min_value:
            if cmdname:
                self.errmsg(("Command '%s' expects an integer at least" +
                             ' %d; got: %d.')
                            % (cmdname, min_value, default))
            else:
                self.errmsg(("Expecting a positive integer at least" +
                             ' %d; got: %d')
                            % (min_value, default))
                pass
            return None
        elif at_most and default > at_most:
            if cmdname:
                self.errmsg(("Command '%s' expects an integer at most" +
                             ' %d; got: %d.')
                            % (cmdname, at_most, default))
            else:
                self.errmsg(("Expecting an integer at most %d; got: %d")
                            % (at_most, default))
                pass
            pass
        return default
def get_int(self, arg, min_value=0, default=1, cmdname=None,
                at_most=None):
        if arg is None: return default
        default = self.get_int_noerr(arg)
        if default is None:
            if cmdname:
                self.errmsg(("Command '%s' expects an integer; "
                             + "got: %s.") % (cmdname, str(arg)))
            else:
                self.errmsg('Expecting a positive integer, got: %s'
                            % str(arg))
                pass
            return None
            pass
        if default < min_value:
            if cmdname:
                self.errmsg(("Command '%s' expects an integer at least" +
                             ' %d; got: %d.')
                            % (cmdname, min_value, default))
            else:
                self.errmsg(("Expecting a positive integer at least" +
                             ' %d; got: %d')
                            % (min_value, default))
                pass
            return None
        elif at_most and default > at_most:
            if cmdname:
                self.errmsg(("Command '%s' expects an integer at most" +
                             ' %d; got: %d.')
                            % (cmdname, at_most, default))
            else:
                self.errmsg(("Expecting an integer at most %d; got: %d")
                            % (at_most, default))
                pass
            pass
        return default
def get_int ( self , arg , min_value = 0 , default = 1 , cmdname = None , at_most = None ) : if arg is None : return default default = self . get_int_noerr ( arg ) if default is None : if cmdname : self . errmsg ( ( "Command '%s' expects an integer; " + "got: %s." ) % ( cmdname , str ( arg ) ) ) else : self . errmsg ( 'Expecting a positive integer, got: %s' % str ( arg ) ) pass return None pass if default < min_value : if cmdname : self . errmsg ( ( "Command '%s' expects an integer at least" + ' %d; got: %d.' ) % ( cmdname , min_value , default ) ) else : self . errmsg ( ( "Expecting a positive integer at least" + ' %d; got: %d' ) % ( min_value , default ) ) pass return None elif at_most and default > at_most : if cmdname : self . errmsg ( ( "Command '%s' expects an integer at most" + ' %d; got: %d.' ) % ( cmdname , at_most , default ) ) else : self . errmsg ( ( "Expecting an integer at most %d; got: %d" ) % ( at_most , default ) ) pass pass return default
If no argument use the default. If arg is a an integer between
        least min_value and at_most, use that. Otherwise report an error.
        If there's a stack frame use that in evaluation.
If no argument use the default . If arg is a an integer between least min_value and at_most use that . Otherwise report an error . If there s a stack frame use that in evaluation .