add limit to number of commets script can make in one pass
This commit is contained in:
parent
726f0b11dc
commit
98566a2d06
@ -22,6 +22,7 @@ DEFAULT_WORKING_DIRECTORY = './tmp'
|
|||||||
DEFAULT_APP_URL = 'https://app.flightschedulepro.com'
|
DEFAULT_APP_URL = 'https://app.flightschedulepro.com'
|
||||||
DEFAULT_TIMEOUT = 10 # seconds
|
DEFAULT_TIMEOUT = 10 # seconds
|
||||||
DEFAULT_DAY_LOOKAHEAD = 2
|
DEFAULT_DAY_LOOKAHEAD = 2
|
||||||
|
DEFAULT_MAX_COMMENTS = 5
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
@ -154,6 +155,8 @@ def filter_row_by_date(reservation_row: webelement.WebElement) -> bool:
|
|||||||
rows = get_reservation_rows()
|
rows = get_reservation_rows()
|
||||||
|
|
||||||
row_count = len(rows)
|
row_count = len(rows)
|
||||||
|
if row_count > DEFAULT_MAX_COMMENTS:
|
||||||
|
die('Found more than ' + str(DEFAULT_MAX_COMMENTS) + ' reservations. Aborting...')
|
||||||
print('found ' + str(row_count) + ' reservations to add reservation comment to')
|
print('found ' + str(row_count) + ' reservations to add reservation comment to')
|
||||||
for i in range(0, row_count):
|
for i in range(0, row_count):
|
||||||
row = rows[i]
|
row = rows[i]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user