def _start_timer_with_settings(self, name, hours, minutes, seconds, command, next_timer, auto_start): print "Resetting timer" if self.timer.get_state() != Timer.STATE_IDLE: self.timer.reset() self.timer.set_duration(utils.hms_to_seconds(hours, minutes, seconds)) self.timer.set_name(name) self.timer.set_command(command) self.timer.set_next_timer(next_timer) self.timer.set_auto_start(auto_start) self.timer.start()
def _start_timer_with_settings(self, name, hours, minutes, seconds, command, next_timer, auto_start): print "Resetting timer" if self._timer.get_state() != core.Timer.STATE_IDLE: self._timer.reset() self._timer.set_duration(utils.hms_to_seconds(hours, minutes, seconds)) self._timer.set_name(name) self._timer.set_command(command) self._timer.set_next_timer(next_timer) self._timer.set_auto_start(auto_start) self._timer.start()
def add_xml_node(model, path, row_iter): (name, hours, minutes, seconds, command, next_timer, auto_start) = \ model.get(row_iter, PresetsStore._NAME_COL, PresetsStore._HOURS_COL, PresetsStore._MINUTES_COL, PresetsStore._SECONDS_COL, PresetsStore._COM_COL, PresetsStore._NEXT_COL, PresetsStore._AUTO_START_COL ) node = et.SubElement(root, 'preset') node.set('name', name) node.set('duration', str(hms_to_seconds(hours, minutes, seconds))) node.set('command', command or '') node.set('next_timer', next_timer or '') node.set('auto_start', serialize_bool(auto_start))
def Start(self, name, hours, minutes, seconds): if self._timer.get_state() != core.Timer.STATE_IDLE: self._timer.reset() self._timer.set_duration(utils.hms_to_seconds(hours, minutes, seconds)) self._timer.set_name(name) self._timer.start()