mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 11:48:03 +00:00
Bug fix: parse_size values
This commit is contained in:
@@ -25,6 +25,7 @@ ADD_STA_FLAGS_DOWN_WPA2 = 68719477760
|
|||||||
REPORT_TIMER_MS_FAST = 1500
|
REPORT_TIMER_MS_FAST = 1500
|
||||||
REPORT_TIMER_MS_SLOW = 3000
|
REPORT_TIMER_MS_SLOW = 3000
|
||||||
|
|
||||||
|
#Used for Speed
|
||||||
def parse_size_bps(size_val):
|
def parse_size_bps(size_val):
|
||||||
if isinstance(size_val, str):
|
if isinstance(size_val, str):
|
||||||
size_val.upper()
|
size_val.upper()
|
||||||
@@ -46,6 +47,7 @@ def parse_size_bps(size_val):
|
|||||||
else:
|
else:
|
||||||
return size_val
|
return size_val
|
||||||
|
|
||||||
|
#Used for Size of file
|
||||||
def parse_size(size_val):
|
def parse_size(size_val):
|
||||||
if isinstance(size_val, str):
|
if isinstance(size_val, str):
|
||||||
size_val.upper()
|
size_val.upper()
|
||||||
@@ -56,11 +58,11 @@ def parse_size(size_val):
|
|||||||
unit = str(td.group(2)).lower()
|
unit = str(td.group(2)).lower()
|
||||||
# print(1, size, unit)
|
# print(1, size, unit)
|
||||||
if unit == 'g':
|
if unit == 'g':
|
||||||
size *= 10000000
|
size *= 1073741824
|
||||||
elif unit == 'm':
|
elif unit == 'm':
|
||||||
size *= 100000
|
size *= 1048576
|
||||||
elif unit == 'k':
|
elif unit == 'k':
|
||||||
size *= 1000
|
size *= 1024
|
||||||
# print(2, size, unit)
|
# print(2, size, unit)
|
||||||
return size
|
return size
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user