def addTimerByEventID(self, param): state, statetext = Timer.addTimerByEventID(self, param) if state: sRef = param['sRef'] eit = int(param['eventid']) vpsplugin_enabled = None if 'vpsplugin_enabled' in param: vpsplugin_enabled = True if param['vpsplugin_enabled'] == '1' else False vpsplugin_overwrite = None if 'vpsplugin_overwrite' in param: vpsplugin_overwrite = True if param['vpsplugin_overwrite'] == '1' else False vpsplugin_time = None if 'vpsplugin_time' in param: vpsplugin_time = int(float(param['vpsplugin_time'])) if vpsplugin_time == -1: vpsplugin_time = None for timer in self.recordtimer.timer_list + self.recordtimer.processed_timers: if sRef == str(timer.service_ref) and eit == timer.eit: print "[WebComponents.Vps] addTimerByEventID: Found new timer, changing!" timer.vpsplugin_enabled = vpsplugin_enabled timer.vpsplugin_overwrite = vpsplugin_overwrite timer.vpsplugin_time = vpsplugin_time now = int(time.time()) if vpsplugin_enabled and timer.begin <= now + 900 and now <= timer.end: vps_timers.checksoon() break return state, statetext
def addTimerByEventID(self, param): state, statetext = Timer.addTimerByEventID(self, param) if state: sRef = param['sRef'] eit = int(param['eventid']) vpsplugin_enabled = None if 'vpsplugin_enabled' in param: vpsplugin_enabled = True if param[ 'vpsplugin_enabled'] == '1' else False vpsplugin_overwrite = None if 'vpsplugin_overwrite' in param: vpsplugin_overwrite = True if param[ 'vpsplugin_overwrite'] == '1' else False vpsplugin_time = None if 'vpsplugin_time' in param: vpsplugin_time = int(float(param['vpsplugin_time'])) if vpsplugin_time == -1: vpsplugin_time = None for timer in self.recordtimer.timer_list + self.recordtimer.processed_timers: if sRef == str(timer.service_ref) and eit == timer.eit: print( "[WebComponents.Vps] addTimerByEventID: Found new timer, changing!" ) timer.vpsplugin_enabled = vpsplugin_enabled timer.vpsplugin_overwrite = vpsplugin_overwrite timer.vpsplugin_time = vpsplugin_time now = int(time.time()) if vpsplugin_enabled and timer.begin <= now + 900 and now <= timer.end: vps_timers.checksoon() break return state, statetext
def editTimer(self, param): state, statetext = Timer.editTimer(self, param) if state: # find the timer and assign vps settings sRef = param['sRef'] begin = int(float(param['begin'])) end = int(float(param['end'])) name = param['name'] description = param['description'] vpsplugin_enabled = None if 'vpsplugin_enabled' in param: vpsplugin_enabled = True if param['vpsplugin_enabled'] == '1' else False vpsplugin_overwrite = None if 'vpsplugin_overwrite' in param: vpsplugin_overwrite = True if param['vpsplugin_overwrite'] == '1' else False vpsplugin_time = None if 'vpsplugin_time' in param: vpsplugin_time = int(float(param['vpsplugin_time'])) if vpsplugin_time == -1: vpsplugin_time = None for timer in self.recordtimer.timer_list + self.recordtimer.processed_timers: if sRef == str(timer.service_ref) and begin == int(timer.begin) \ and end == int(timer.end) and name == timer.name \ and description == timer.description: print "[WebComponents.Vps] editTimer: Timer changed!" timer.vpsplugin_enabled = vpsplugin_enabled timer.vpsplugin_overwrite = vpsplugin_overwrite timer.vpsplugin_time = vpsplugin_time now = int(time.time()) if vpsplugin_enabled and begin <= now + 900 and now <= end: vps_timers.checksoon() break return state, statetext
def editTimer(self, param): state, statetext = Timer.editTimer(self, param) if state: # find the timer and assign vps settings sRef = param['sRef'] begin = int(float(param['begin'])) end = int(float(param['end'])) name = param['name'] description = param['description'] vpsplugin_enabled = None if 'vpsplugin_enabled' in param: vpsplugin_enabled = True if param[ 'vpsplugin_enabled'] == '1' else False vpsplugin_overwrite = None if 'vpsplugin_overwrite' in param: vpsplugin_overwrite = True if param[ 'vpsplugin_overwrite'] == '1' else False vpsplugin_time = None if 'vpsplugin_time' in param: vpsplugin_time = int(float(param['vpsplugin_time'])) if vpsplugin_time == -1: vpsplugin_time = None for timer in self.recordtimer.timer_list + self.recordtimer.processed_timers: if sRef == str(timer.service_ref) and begin == int(timer.begin) \ and end == int(timer.end) and name == timer.name \ and description == timer.description: print("[WebComponents.Vps] editTimer: Timer changed!") timer.vpsplugin_enabled = vpsplugin_enabled timer.vpsplugin_overwrite = vpsplugin_overwrite timer.vpsplugin_time = vpsplugin_time now = int(time.time()) if vpsplugin_enabled and begin <= now + 900 and now <= end: vps_timers.checksoon() break return state, statetext