osbot-utils 2.60.0__py3-none-any.whl → 2.61.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- osbot_utils/helpers/safe_int/{Safe_Int__UInt.py → Safe_UInt.py} +1 -1
- osbot_utils/helpers/safe_int/Safe_UInt__Byte.py +10 -0
- osbot_utils/helpers/safe_int/Safe_UInt__FileSize.py +19 -0
- osbot_utils/helpers/safe_int/Safe_UInt__Percentage.py +10 -0
- osbot_utils/helpers/safe_int/Safe_UInt__Port.py +11 -0
- osbot_utils/version +1 -1
- {osbot_utils-2.60.0.dist-info → osbot_utils-2.61.0.dist-info}/METADATA +2 -2
- {osbot_utils-2.60.0.dist-info → osbot_utils-2.61.0.dist-info}/RECORD +10 -10
- osbot_utils/helpers/safe_int/Safe_Int__Byte.py +0 -11
- osbot_utils/helpers/safe_int/Safe_Int__FileSize.py +0 -19
- osbot_utils/helpers/safe_int/Safe_Int__Percentage.py +0 -10
- osbot_utils/helpers/safe_int/Safe_Int__Port.py +0 -11
- {osbot_utils-2.60.0.dist-info → osbot_utils-2.61.0.dist-info}/LICENSE +0 -0
- {osbot_utils-2.60.0.dist-info → osbot_utils-2.61.0.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
from osbot_utils.helpers.safe_int.Safe_Int import Safe_Int
|
2
2
|
|
3
|
-
class
|
3
|
+
class Safe_UInt(Safe_Int): # Unsigned Integer - only accepts non-negative integer values
|
4
4
|
|
5
5
|
min_value = 0 # Unsigned means >= 0
|
6
6
|
max_value = None # No upper limit by default
|
@@ -0,0 +1,10 @@
|
|
1
|
+
from osbot_utils.helpers.safe_int.Safe_UInt import Safe_UInt
|
2
|
+
|
3
|
+
TYPE_SAFE_UINT__BYTE__MIN_VALUE = 0
|
4
|
+
TYPE_SAFE_UINT__BYTE__MAX_VALUE = 255
|
5
|
+
|
6
|
+
class Safe_UInt__Byte(Safe_UInt): # Single byte value (0-255)
|
7
|
+
|
8
|
+
min_value = TYPE_SAFE_UINT__BYTE__MIN_VALUE
|
9
|
+
max_value = TYPE_SAFE_UINT__BYTE__MAX_VALUE
|
10
|
+
allow_bool = False
|
@@ -0,0 +1,19 @@
|
|
1
|
+
from osbot_utils.helpers.safe_int.Safe_UInt import Safe_UInt
|
2
|
+
|
3
|
+
TYPE_SAFE_UINT__FILE_SIZE__MIN_VALUE = 0
|
4
|
+
TYPE_SAFE_UINT__FILE_SIZE__MAX_VALUE = 2 ** 63 - 1 # Max file size on most systems
|
5
|
+
|
6
|
+
class Safe_UInt__FileSize(Safe_UInt): # File size in bytes
|
7
|
+
|
8
|
+
min_value = TYPE_SAFE_UINT__FILE_SIZE__MIN_VALUE
|
9
|
+
max_value = TYPE_SAFE_UINT__FILE_SIZE__MAX_VALUE
|
10
|
+
allow_bool = False
|
11
|
+
|
12
|
+
def to_kb(self) -> float:
|
13
|
+
return self / 1024
|
14
|
+
|
15
|
+
def to_mb(self) -> float:
|
16
|
+
return self / (1024 * 1024)
|
17
|
+
|
18
|
+
def to_gb(self) -> float:
|
19
|
+
return self / (1024 * 1024 * 1024)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
from osbot_utils.helpers.safe_int.Safe_UInt import Safe_UInt
|
2
|
+
|
3
|
+
TYPE_SAFE_UINT__PERCENTAGE__MIN_VALUE = 0
|
4
|
+
TYPE_SAFE_UINT__PERCENTAGE__MAX_VALUE = 100
|
5
|
+
|
6
|
+
class Safe_UInt__Percentage(Safe_UInt): # Percentage value (0-100)
|
7
|
+
|
8
|
+
min_value = TYPE_SAFE_UINT__PERCENTAGE__MIN_VALUE
|
9
|
+
max_value = TYPE_SAFE_UINT__PERCENTAGE__MAX_VALUE
|
10
|
+
allow_bool = False
|
@@ -0,0 +1,11 @@
|
|
1
|
+
from osbot_utils.helpers.safe_int.Safe_UInt import Safe_UInt
|
2
|
+
|
3
|
+
TYPE_SAFE_UINT__PORT__MIN_VALUE = 0
|
4
|
+
TYPE_SAFE_UINT__PORT__MAX_VALUE = 65535
|
5
|
+
|
6
|
+
class Safe_UInt__Port(Safe_UInt): # Network port number (0-65535)
|
7
|
+
|
8
|
+
min_value = TYPE_SAFE_UINT__PORT__MIN_VALUE
|
9
|
+
max_value = TYPE_SAFE_UINT__PORT__MAX_VALUE
|
10
|
+
allow_bool = False
|
11
|
+
allow_none = False # don't allow 0 as port value since that is a really weird value for a port
|
osbot_utils/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
v2.
|
1
|
+
v2.61.0
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: osbot_utils
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.61.0
|
4
4
|
Summary: OWASP Security Bot - Utils
|
5
5
|
License: MIT
|
6
6
|
Author: Dinis Cruz
|
@@ -23,7 +23,7 @@ Description-Content-Type: text/markdown
|
|
23
23
|
|
24
24
|
Powerful Python util methods and classes that simplify common apis and tasks.
|
25
25
|
|
26
|
-

|
27
27
|
[](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
|
28
28
|
|
29
29
|
|
@@ -247,11 +247,11 @@ osbot_utils/helpers/safe_float/Safe_Float__Money.py,sha256=Abh_CX8849rtKgAu-hCxw
|
|
247
247
|
osbot_utils/helpers/safe_float/Safe_Float__Percentage_Exact.py,sha256=l_nGfa2-VCgdBeUXYQAR2wawc4362A9GsCOpWZ3Sdd4,286
|
248
248
|
osbot_utils/helpers/safe_float/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
249
249
|
osbot_utils/helpers/safe_int/Safe_Int.py,sha256=eXOJjZ8CgXshFQcPVwL1lOdemF8X65Jy0NFJTlt6QG8,3034
|
250
|
-
osbot_utils/helpers/safe_int/
|
251
|
-
osbot_utils/helpers/safe_int/
|
252
|
-
osbot_utils/helpers/safe_int/
|
253
|
-
osbot_utils/helpers/safe_int/
|
254
|
-
osbot_utils/helpers/safe_int/
|
250
|
+
osbot_utils/helpers/safe_int/Safe_UInt.py,sha256=lU8TiNNpa9Vwg-FK0btk_bRaV_GYcGpBjHjFAdw5f08,317
|
251
|
+
osbot_utils/helpers/safe_int/Safe_UInt__Byte.py,sha256=850zWYmowGE7NlkVocNewphWGXzBeWtVRV_zs2XFrxI,328
|
252
|
+
osbot_utils/helpers/safe_int/Safe_UInt__FileSize.py,sha256=pj1_Gf48JVXbnnvx5-YqbQfUsyV_PChVzh1Nnk7PuBY,602
|
253
|
+
osbot_utils/helpers/safe_int/Safe_UInt__Percentage.py,sha256=Ck-jiu6NK57Y3ruAjIJ0k-maiKcB2Q7M3t9nKf-8ga8,357
|
254
|
+
osbot_utils/helpers/safe_int/Safe_UInt__Port.py,sha256=uISrh8VKXiEQULQ1POU9YK8Di6z_vr0HWjCTpjA0YaY,482
|
255
255
|
osbot_utils/helpers/safe_int/__init__.py,sha256=kMU2WMsdQmayBEZugxnJV_wRW3O90bc118sx6iIm_mQ,310
|
256
256
|
osbot_utils/helpers/safe_str/Safe_Str.py,sha256=qc_wO1okHamcOOtv6-cvmPvF1Eh1A7-Pk4P4MSzOb24,3375
|
257
257
|
osbot_utils/helpers/safe_str/Safe_Str__File__Name.py,sha256=ncjkQ2hAhw0a3UulrCuQsA9ytrFwg5CT1XRJIGChMpY,289
|
@@ -425,8 +425,8 @@ osbot_utils/utils/Toml.py,sha256=Rxl8gx7mni5CvBAK-Ai02EKw-GwtJdd3yeHT2kMloik,166
|
|
425
425
|
osbot_utils/utils/Version.py,sha256=Ww6ChwTxqp1QAcxOnztkTicShlcx6fbNsWX5xausHrg,422
|
426
426
|
osbot_utils/utils/Zip.py,sha256=pR6sKliUY0KZXmqNzKY2frfW-YVQEVbLKiyqQX_lc-8,14052
|
427
427
|
osbot_utils/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
428
|
-
osbot_utils/version,sha256=
|
429
|
-
osbot_utils-2.
|
430
|
-
osbot_utils-2.
|
431
|
-
osbot_utils-2.
|
432
|
-
osbot_utils-2.
|
428
|
+
osbot_utils/version,sha256=A0AXkXECvuIXavsLFlifByi5-p8o9nRkdlWMvuPBgfQ,8
|
429
|
+
osbot_utils-2.61.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
430
|
+
osbot_utils-2.61.0.dist-info/METADATA,sha256=j1Zm2RU9ggsy5f74yYySuzeYAKAV2G0IIbnHR9iQyxQ,1329
|
431
|
+
osbot_utils-2.61.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
432
|
+
osbot_utils-2.61.0.dist-info/RECORD,,
|
@@ -1,11 +0,0 @@
|
|
1
|
-
from osbot_utils.helpers.safe_int.Safe_Int import Safe_Int
|
2
|
-
|
3
|
-
TYPE_SAFE_INT__BYTE__MIN_VALUE = 0
|
4
|
-
TYPE_SAFE_INT__BYTE__MAX_VALUE = 255
|
5
|
-
|
6
|
-
class Safe_Int__Byte(Safe_Int):
|
7
|
-
"""Single byte value (0-255)"""
|
8
|
-
|
9
|
-
min_value = TYPE_SAFE_INT__BYTE__MIN_VALUE
|
10
|
-
max_value = TYPE_SAFE_INT__BYTE__MAX_VALUE
|
11
|
-
allow_bool = False
|
@@ -1,19 +0,0 @@
|
|
1
|
-
from osbot_utils.helpers.safe_int.Safe_Int import Safe_Int
|
2
|
-
|
3
|
-
TYPE_SAFE_INT__FILE_SIZE__MIN_VALUE = 0
|
4
|
-
TYPE_SAFE_INT__FILE_SIZE__MAX_VALUE = 2**63 - 1 # Max file size on most systems
|
5
|
-
|
6
|
-
class Safe_Int__FileSize(Safe_Int): # File size in bytes
|
7
|
-
|
8
|
-
min_value = TYPE_SAFE_INT__FILE_SIZE__MIN_VALUE
|
9
|
-
max_value = TYPE_SAFE_INT__FILE_SIZE__MAX_VALUE
|
10
|
-
allow_bool = False
|
11
|
-
|
12
|
-
def to_kb(self) -> float:
|
13
|
-
return self / 1024
|
14
|
-
|
15
|
-
def to_mb(self) -> float:
|
16
|
-
return self / (1024 * 1024)
|
17
|
-
|
18
|
-
def to_gb(self) -> float:
|
19
|
-
return self / (1024 * 1024 * 1024)
|
@@ -1,10 +0,0 @@
|
|
1
|
-
from osbot_utils.helpers.safe_int.Safe_Int import Safe_Int
|
2
|
-
|
3
|
-
TYPE_SAFE_INT__PERCENTAGE__MIN_VALUE = 0
|
4
|
-
TYPE_SAFE_INT__PERCENTAGE__MAX_VALUE = 100
|
5
|
-
|
6
|
-
class Safe_Int__Percentage(Safe_Int): # Percentage value (0-100)
|
7
|
-
|
8
|
-
min_value = TYPE_SAFE_INT__PERCENTAGE__MIN_VALUE
|
9
|
-
max_value = TYPE_SAFE_INT__PERCENTAGE__MAX_VALUE
|
10
|
-
allow_bool = False
|
@@ -1,11 +0,0 @@
|
|
1
|
-
from osbot_utils.helpers.safe_int.Safe_Int import Safe_Int
|
2
|
-
|
3
|
-
TYPE_SAFE_INT__PORT__MIN_VALUE = 0
|
4
|
-
TYPE_SAFE_INT__PORT__MAX_VALUE = 65535
|
5
|
-
|
6
|
-
class Safe_Int__Port(Safe_Int): # Network port number (0-65535)
|
7
|
-
|
8
|
-
min_value = TYPE_SAFE_INT__PORT__MIN_VALUE
|
9
|
-
max_value = TYPE_SAFE_INT__PORT__MAX_VALUE
|
10
|
-
allow_bool = False
|
11
|
-
allow_none = False # don't allow 0 as port value since that is a really weird value for a port
|
File without changes
|
File without changes
|