def update_schedule(id, name=None, attr_dict={}): schedule = getSchedule(id) if name is not None: schedule.setName(name) for k, v in attr_dict.items(): schedule.set(k, v) return schedule
def create_schedule(name, attr_dict={}): schedules = tree.getRoot("schedules") schedule = tree.Node(name=name, type="schedule") for k, v in attr_dict.items(): schedule.set(k, v) schedules.addChild(schedule) SCHEDULES_TO_BE_READ = True schedules.set("SCHEDULES_TO_BE_READ", "1") return schedule