class ExpStatChecker(Checker): DefaultPath = '/tmp' def __init__(self,path=None): if not path: path = ExpStatChecker.DefaultPath super(ExpStatChecker,self).__init__() self.expstat = ExpStat(path=path) def check(self,t=1): return self.expstat.changes(remember=True) def follow(self,t=1): while not self.shutdown.isSet(): try: changes = self.expstat.changes(remember=True) if len(changes): yield changes time.sleep(t) except IOError: logging.error("IO Error: memory map file %s not accessible?", (self.expstat.expstat_path))
def __init__(self, path=None): if not path: path = ExpStatChecker.DefaultPath super(ExpStatChecker, self).__init__() self.expstat = ExpStat(path=path)
def __init__(self,path=None): if not path: path = ExpStatChecker.DefaultPath super(ExpStatChecker,self).__init__() self.expstat = ExpStat(path=path)