Skip to content

Commit

Permalink
Add override pending argument
Browse files Browse the repository at this point in the history
Adds the ability to override any cities that are currently Pending.
  • Loading branch information
Sliicy committed Aug 7, 2020
1 parent 8814eb5 commit c14eb3d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions eruv_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ def army_to_meridian(input_time):
'--no-weather',
action='store_true',
help='Skip checking for and reporting any weather updates. This will override the force-weather argument.')
parser.add_argument(
'--override-pending',
action='store_true',
help='Include cities that are Pending (they are normally skipped).')
parser.add_argument(
'--phone',
action='append',
Expand Down Expand Up @@ -239,6 +243,9 @@ def army_to_meridian(input_time):
all_numbers = subscriber_sheet.col_values(2)[1:]
all_user_cities = subscriber_sheet.col_values(3)[1:]
whatsapp_list = subscriber_sheet.col_values(4)[1:]
# Catch in case there are no 'WhatsApp' entries (list must be same size as other list, not 0):
if len(whatsapp_list) == 0:
whatsapp_list = [''] * len(subscriber_sheet.col_values(2)[1:])
all_rabbi_cities = rabbi_sheet.col_values(3)[1:]
all_rabbi_zipcodes = rabbi_sheet.col_values(4)[1:]
all_cities = status_sheet.col_values(1)
Expand Down Expand Up @@ -273,8 +280,8 @@ def army_to_meridian(input_time):
city_index += 1
continue

# Skip if the city status is Pending:
if city_statuses[city_index] == 'Pending':
# Skip if the city status is Pending unless requested otherwise:
if city_statuses[city_index] == 'Pending' and not arguments.override_pending:
print('\nSkipping ' + str(city) + " because it's still pending!\n")
city_index += 1
continue
Expand Down

0 comments on commit c14eb3d

Please sign in to comment.