Skip to main content
Version: 8.1

system.user.getSchedules

This function is used in Python Scripting.

Description​

Returns a sequence of all available schedule models, which can be used to return configuration information on the schedule, such as time for each day of the week.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.user.getSchedules()

Parameters​

Nothing

Returns​

List - A list of schedules. Each schedule can be a BasicScheduleModel object, CompositeScheduleModel object, or another type registered by a module.

Scope​

Gateway, Vision Client, Perspective Session

Code Examples​

Example #1
# This example will print a list of all available ScheduleModels.

# This function handles recursive printing of the different schedule models. Modules can register more types than listed here.
def printScheduleInfo(aSchedule):
if aSchedule.getType() == "basic schedule":
print "Basic schedule type: ",aSchedule.getName(), aSchedule.getDescription(), aSchedule.isAllDays(), aSchedule.getAllDayTime()
elif aSchedule.getType() == "composite schedule":
compositePieces = aSchedule.getModels()
print "Composite schedule type:",aSchedule.getName(), aSchedule.getDescription(), " which is made up of..."
for piece in compositePieces:
printScheduleInfo(piece)
else:
print "Other schedule type: ", aSchedule.getName(), aSchedule.getDescription(), aSchedule.getType(), aSchedule.isObserveHolidays()


# The main function.
schedules = system.user.getSchedules()
for schedule in schedules:
printScheduleInfo(schedule)