Returns True if value is a string (or integer) with a positive integer representation >>> isNumPosStrValue(1) True >>> isNumPosStrValue('1') True >>> isNumPosStrValue(0) False >>> isNumPosStrValue('-2') False >>> isNumPosStrValue('100000000000000000000')
(value)
| 3184 | return value |
| 3185 | |
| 3186 | def isNumPosStrValue(value): |
| 3187 | """ |
| 3188 | Returns True if value is a string (or integer) with a positive integer representation |
| 3189 | |
| 3190 | >>> isNumPosStrValue(1) |
| 3191 | True |
| 3192 | >>> isNumPosStrValue('1') |
| 3193 | True |
| 3194 | >>> isNumPosStrValue(0) |
| 3195 | False |
| 3196 | >>> isNumPosStrValue('-2') |
| 3197 | False |
| 3198 | >>> isNumPosStrValue('100000000000000000000') |
| 3199 | False |
| 3200 | """ |
| 3201 | |
| 3202 | retVal = False |
| 3203 | |
| 3204 | try: |
| 3205 | retVal = ((hasattr(value, "isdigit") and value.isdigit() and int(value) > 0) or (isinstance(value, int) and value > 0)) and int(value) < MAX_INT |
| 3206 | except ValueError: |
| 3207 | pass |
| 3208 | |
| 3209 | return retVal |
| 3210 | |
| 3211 | @cachedmethod |
| 3212 | def aliasToDbmsEnum(dbms): |
no outgoing calls
no test coverage detected
searching dependent graphs…