Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
e.name = "Solr Operator %s vote ends" % state.release_version
e.begin = vote_close_72h_date()
e.description = "Remember to sum up votes and continue release :)"
c.events.add(e)
ics_file = os.path.join(state.get_rc_folder(), 'vote_end.ics')
with open(ics_file, 'w') as my_file:
my_file.writelines(c)
open_file(ics_file)
return True
today = datetime.utcnow().date()
sundays = {(today + timedelta(days=x)): 'Sunday' for x in range(10) if (today + timedelta(days=x)).weekday() == 6}
y = datetime.utcnow().year
years = [y, y+1]
non_working = holidays.CA(years=years) + holidays.US(years=years) + holidays.England(years=years) \
+ holidays.DE(years=years) + holidays.NO(years=years) + holidays.IND(years=years) + holidays.RU(years=years)
def vote_close_72h_date():
# Voting open at least 72 hours according to ASF policy
return datetime.utcnow() + timedelta(hours=73)
def vote_close_72h_holidays():
days = 0
day_offset = -1
holidays = []
# Warn RM about major holidays coming up that should perhaps extend the voting deadline
# Warning will be given for Sunday or a public holiday observed by 3 or more [CA, US, EN, DE, NO, IND, RU]
while days < 3:
day_offset += 1
e.name = "Lucene/Solr %s vote ends" % state.release_version
e.begin = vote_close_72h_date()
e.description = "Remember to sum up votes and continue release :)"
c.events.add(e)
ics_file = os.path.join(state.get_rc_folder(), 'vote_end.ics')
with open(ics_file, 'w') as my_file:
my_file.writelines(c)
open_file(ics_file)
return True
today = datetime.utcnow().date()
sundays = {(today + timedelta(days=x)): 'Sunday' for x in range(10) if (today + timedelta(days=x)).weekday() == 6}
y = datetime.utcnow().year
years = [y, y+1]
non_working = holidays.CA(years=years) + holidays.US(years=years) + holidays.England(years=years) \
+ holidays.DE(years=years) + holidays.NO(years=years) + holidays.IND(years=years) + holidays.RU(years=years)
def vote_close_72h_date():
# Voting open at least 72 hours according to ASF policy
return datetime.utcnow() + timedelta(hours=73)
def vote_close_72h_holidays():
days = 0
day_offset = -1
holidays = []
# Warn RM about major holidays coming up that should perhaps extend the voting deadline
# Warning will be given for Sunday or a public holiday observed by 3 or more [CA, US, EN, DE, NO, IND, RU]
while days < 3:
day_offset += 1