| 46 | setattr(optionparser.values, option.dest, option.default) |
| 47 | else : |
| 48 | setattr(optionparser.values, option.dest, value) |
| 49 | |
| 50 | def checkandset_positiveint(option, opt, value, optionparser) : |
| 51 | """Checks if an option argument is a positive integer and validates the option if it is the case.""" |
| 52 | if not (value >= 0) : |
| 53 | loginvalidparam(opt, value, option.default, \ |
| 54 | _("Value must be positive")) |
| 55 | setattr(optionparser.values, option.dest, option.default) |
| 56 | else : |
| 57 | setattr(optionparser.values, option.dest, value) |
| 58 | |
| 59 | def checkandset_positivefloat(option, opt, value, optionparser) : |
| 60 | """Checks if an option argument is a positive integer and validates the option if it is the case.""" |
| 61 | if not (value >= 0.0) : |
| 62 | loginvalidparam(opt, value, option.default, \ |
| 63 | _("Value must be positive")) |