PyShift Work Schedule
Work Schedule for Python
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
time_period.TimePeriod Class Reference

Class TimePeriod is a named period of time with a specified duration and starting time of day. More...

Inheritance diagram for time_period.TimePeriod:

Public Member Functions

def __init__ (self, str name, str description, datetime startTime, timedelta duration)
 Construct a time period. More...
 
def setDuration (self, timedelta duration)
 Set duration. More...
 
time timePlus (self, time dayTime, timedelta duration)
 add duration to a time of day More...
 
time getEndTime (self)
 Get period end. More...
 
def setStartTime (self, time startTime)
 Set period start time. More...
 
str __str__ (self)
 

Public Attributes

 duration
 
 startTime
 

Static Public Attributes

int SECONDS_PER_DAY = 24 * 60 * 60
 

Detailed Description

Class TimePeriod is a named period of time with a specified duration and starting time of day.

Constructor & Destructor Documentation

◆ __init__()

def time_period.TimePeriod.__init__ (   self,
str  name,
str  description,
datetime  startTime,
timedelta  duration 
)

Construct a time period.

Parameters
nameName of period
descriptionDescription of period
startTimeStarting date and time of day
durationDuration of time period

Member Function Documentation

◆ getEndTime()

time time_period.TimePeriod.getEndTime (   self)

Get period end.

Returns
End time of day

◆ setDuration()

def time_period.TimePeriod.setDuration (   self,
timedelta  duration 
)

Set duration.

Parameters
durationperiod duration as timedelta

◆ setStartTime()

def time_period.TimePeriod.setStartTime (   self,
time  startTime 
)

Set period start time.

Parameters
startTimeStarting time of day

◆ timePlus()

time time_period.TimePeriod.timePlus (   self,
time  dayTime,
timedelta  duration 
)

add duration to a time of day

Parameters
dayTimetime of day
durationduration to add
Returns
new time

The documentation for this class was generated from the following file: