Update Doors_Schedule.py
Browse files- Doors_Schedule.py +13 -6
Doors_Schedule.py
CHANGED
|
@@ -420,22 +420,29 @@ def get_cleaned_data(locations):
|
|
| 420 |
return new_data
|
| 421 |
|
| 422 |
|
|
|
|
| 423 |
def get_width_info_tobeprinted(new_data):
|
| 424 |
width_info_tobeprinted = []
|
| 425 |
if len(new_data[0]) == 4:
|
| 426 |
for _,_,_, w in new_data:
|
| 427 |
-
w = re.sub(r",", "", w)
|
| 428 |
-
w = int(float(w))
|
| 429 |
width_info_tobeprinted.append(w)
|
| 430 |
if len(new_data[0]) == 5:
|
| 431 |
for _,_,_, w,h in new_data:
|
| 432 |
w = re.sub(r",", "", w)
|
| 433 |
h = re.sub(r",", "", h)
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 437 |
return width_info_tobeprinted
|
| 438 |
-
|
| 439 |
def clean_dimensions(text):
|
| 440 |
# Remove commas and "mm"
|
| 441 |
text = re.sub(r'[,\s]*mm', '', text) # Remove "mm" with optional spaces or commas before it
|
|
|
|
| 420 |
return new_data
|
| 421 |
|
| 422 |
|
| 423 |
+
# law 0.5 maslan tetkatab we law mesh keda yesheel el decimal point
|
| 424 |
def get_width_info_tobeprinted(new_data):
|
| 425 |
width_info_tobeprinted = []
|
| 426 |
if len(new_data[0]) == 4:
|
| 427 |
for _,_,_, w in new_data:
|
| 428 |
+
#w = re.sub(r",", "", w)
|
| 429 |
+
#w = int(float(w))
|
| 430 |
width_info_tobeprinted.append(w)
|
| 431 |
if len(new_data[0]) == 5:
|
| 432 |
for _,_,_, w,h in new_data:
|
| 433 |
w = re.sub(r",", "", w)
|
| 434 |
h = re.sub(r",", "", h)
|
| 435 |
+
if float(w).is_integer():
|
| 436 |
+
w = int(float(w))
|
| 437 |
+
else:
|
| 438 |
+
w = w
|
| 439 |
+
if float(h).is_integer():
|
| 440 |
+
h = int(float(h))
|
| 441 |
+
else:
|
| 442 |
+
h = h
|
| 443 |
+
width_info_tobeprinted.append(f"{w} mm wide x {h} mm high")
|
| 444 |
return width_info_tobeprinted
|
| 445 |
+
|
| 446 |
def clean_dimensions(text):
|
| 447 |
# Remove commas and "mm"
|
| 448 |
text = re.sub(r'[,\s]*mm', '', text) # Remove "mm" with optional spaces or commas before it
|