Feat: Handle get_lot when RECAPITULATIF is nan
This commit is contained in:
parent
b0333cddd8
commit
0040dccd9a
@ -32,7 +32,10 @@ def is_it(page_text):
|
|||||||
def get_lot(txt):
|
def get_lot(txt):
|
||||||
"""Return lot number from "RECAPITULATIF DES OPERATIONS" """
|
"""Return lot number from "RECAPITULATIF DES OPERATIONS" """
|
||||||
regex = r"[BSM](\d+)(?=\s*-)"
|
regex = r"[BSM](\d+)(?=\s*-)"
|
||||||
result = re.findall(regex, txt)
|
try:
|
||||||
|
result = re.findall(regex, txt)
|
||||||
|
except TypeError:
|
||||||
|
return "*"
|
||||||
if result:
|
if result:
|
||||||
return "{:02d}".format(int(result[0]))
|
return "{:02d}".format(int(result[0]))
|
||||||
return "*"
|
return "*"
|
||||||
|
Loading…
Reference in New Issue
Block a user