Skip to content

ChoreFrequency

ChoreFrequency(days, hours, minutes, seconds)

Bases: TM1Object

Utility class to handle time representation fore Chore Frequency

Source code in TM1py/Objects/ChoreFrequency.py
def __init__(
    self, days: Union[str, int], hours: Union[str, int], minutes: Union[str, int], seconds: Union[str, int]
):
    self._days = str(days).zfill(2)
    self._hours = str(hours).zfill(2)
    self._minutes = str(minutes).zfill(2)
    self._seconds = str(seconds).zfill(2)

days property writable

frequency_string property

hours property writable

minutes property writable

seconds property writable

__str__()

Source code in TM1py/Objects/ChoreFrequency.py
def __str__(self) -> str:
    return self.frequency_string

from_string(frequency_string) classmethod

Source code in TM1py/Objects/ChoreFrequency.py
@classmethod
def from_string(cls, frequency_string: str) -> "ChoreFrequency":
    pos_dt = frequency_string.find("DT", 1)
    pos_h = frequency_string.find("H", pos_dt)
    pos_m = frequency_string.find("M", pos_h)
    pos_s = len(frequency_string) - 1
    return cls(
        days=frequency_string[1:pos_dt],
        hours=frequency_string[pos_dt + 2 : pos_h],
        minutes=frequency_string[pos_h + 1 : pos_m],
        seconds=frequency_string[pos_m + 1 : pos_s],
    )