def __log_holidays(self, sprint_dates): holidays = helper.get_holidays_list() print 'Logging holidays...' for holiday in holidays: if sprint_dates[0] <= holiday <= sprint_dates[1]: worklog = self.jira.add_worklog(self.params['holidays_id'], '8h', started=parser.parse(holiday + 'T08:00:00-00:00'), comment=holidays[holiday]) if not isinstance(worklog, int): raise RuntimeError('There was a problem logging your holidays.')
def __generate_date_list(self, start, end): start = datetime.strptime(start, '%Y-%m-%d') end = datetime.strptime(end, '%Y-%m-%d') dates = [] for day in range(0, (end-start).days + 1): date = start + timedelta(days=day) if date.weekday() not in [5, 6] and date.strftime('%Y-%m-%d') not in helper.get_holidays_list().keys(): dates.append(date.strftime('%Y-%m-%d')) return dates
def __generate_date_list(self, start, end): start = datetime.strptime(start, '%Y-%m-%d') end = datetime.strptime(end, '%Y-%m-%d') dates = [] for day in range(0, (end - start).days + 1): date = start + timedelta(days=day) if date.weekday() not in [5, 6] and date.strftime( '%Y-%m-%d') not in helper.get_holidays_list().keys(): dates.append(date.strftime('%Y-%m-%d')) return dates
def __log_holidays(self, sprint_dates): holidays = helper.get_holidays_list() print 'Logging holidays...' for holiday in holidays: if sprint_dates[0] <= holiday <= sprint_dates[1]: worklog = self.jira.add_worklog( self.params['holidays_id'], '8h', started=parser.parse(holiday + 'T08:00:00-00:00'), comment=holidays[holiday]) if not isinstance(worklog, int): raise RuntimeError( 'There was a problem logging your holidays.')