Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Created April 15, 2020 06:22
# For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-python
filename = 'New_project_2013.mpp'
self.upload_file(filename)
exception = CalendarException()
exception.working_times = []
exception.days_of_week = []
exception.name = "Non-working day exception"
exception.day_working = False
exception.from_date = datetime(2014, 9, 27, 8)
exception.to_date = datetime(2015, 7, 5, 8)
exception.occurrences = 10
exception.type = CalendarExceptionType.MONTHLYBYDAY
exception.entered_by_occurrences = True
exception.month_day = 5
exception.period = 1
post_request = PostCalendarExceptionRequest(filename, 1, exception)
post_result = self.tasks_api.post_calendar_exception(post_request)
self.assertIsNotNone(post_result)
self.assertIsInstance(post_result, AsposeResponse)
get_request = GetCalendarExceptionsRequest(filename, 1)
get_result = self.tasks_api.get_calendar_exceptions(get_request)
self.assertIsNotNone(get_result)
self.assertIsInstance(get_result, CalendarExceptionsResponse)
self.assertEqual(1, len(get_result.calendar_exceptions))
self.__assert_calendar_exceptions_are_equal(exception, get_result.calendar_exceptions[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment