示例#1
0
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))
示例#2
0
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))
示例#3
0
 def __init__(self, path=None):
     if not path: path = ExpStatChecker.DefaultPath
     super(ExpStatChecker, self).__init__()
     self.expstat = ExpStat(path=path)
示例#4
0
 def __init__(self,path=None):
     if not path: path = ExpStatChecker.DefaultPath
     super(ExpStatChecker,self).__init__()
     self.expstat = ExpStat(path=path)