def _argusWait(self,secondsToWait):
        startTime = datetime.now() 
        
        #self._log("Observing recorder queue for %s. Use 'sleepModeOn' for VCR mode"%OSTools.convertSecondsToString(secondsToWait))
        self._log("Observing recorder queue until %s. Execute 'sleepModeOn' for VCR mode"%OSTools.showDateTimeWithOffset(secondsToWait))
        lastQCheck=None
        while (OSTools.getDifferenceInSeconds(datetime.now(),startTime) < secondsToWait):
            xtime.sleep(self.PRERUN_SECONDS)
            path=self._config().getRecQueuePath()
            try:
                currentModificationTime=OSTools.getLastModificationTime(path)
            except OSError as osError:
                currentModificationTime=0.0
                self._config().logError("Error checking rec file:"+osError.strerror) 
                print("Error checking rec file")                       
            #check for socket or file changes... 
            if lastQCheck is None:
                lastQCheck=currentModificationTime #we came from a queue check-so thats the last time we checked 
            if currentModificationTime-lastQCheck>0:
                self._log("Rec Q modified-looking for jobs")
                return False
            if self._daemon.isVCRPolicyChangeRequested(): 
                return False
 
        return True
    def checkEPGData(self):
        fileName = self.configuration.getCachedXMLTVFilePath()
        currentModificationtime = 0
        try:
            currentModificationtime = OSTools.getLastModificationTime(fileName)
        except OSError as osError:
            msg = "CheckEpgData:" + osError.strerror
            self.configuration.logError(msg)                        
            self.storeLastMessage(msg)
            return
            
#         if self._lastEpgRead is None:
#             self._lastEpgRead= currentModificationtime-100

        if currentModificationtime - self._lastEpgRead > 60:
            self._lastEpgRead = currentModificationtime
            self._readCachedEpgData()
Beispiel #3
0
    def checkEPGData(self):
        fileName = self.configuration.getCachedXMLTVFilePath()
        currentModificationtime = 0
        try:
            currentModificationtime = OSTools.getLastModificationTime(fileName)
        except OSError as osError:
            msg = "CheckEpgData:" + osError.strerror
            self.configuration.logError(msg)
            self.storeLastMessage(msg)
            return


#         if self._lastEpgRead is None:
#             self._lastEpgRead= currentModificationtime-100

        if currentModificationtime - self._lastEpgRead > 60:
            self._lastEpgRead = currentModificationtime
            self._readCachedEpgData()