Ejemplo n.º 1
0
    def test_target(self,id):
        try:
            i = int(id)
        except ValueError:
            print '%s is not a valid id' % id
            return
        targetmodel = TargetModel(self.logger,self.config)
        target = targetmodel.get(i)
        if target == None:
            print('id: %d does not exist' % i)
            return

        puncher = Puncher(self.logger,targetmodel,None)
        puncher.punch_it_now(target)
Ejemplo n.º 2
0
    def test_target(self, id):
        try:
            i = int(id)
        except ValueError:
            print '%s is not a valid id' % id
            return
        targetmodel = TargetModel(self.logger, self.config)
        target = targetmodel.get(i)
        if target == None:
            print('id: %d does not exist' % i)
            return

        puncher = Puncher(self.logger, targetmodel, None)
        puncher.punch_it_now(target)
Ejemplo n.º 3
0
 def run(self):
     print 'starting %s ....' % PROGNAME
     logger.info('starting %s ....' % PROGNAME)
     config = SkyPunchConfig(logger)	
     targetmodel = TargetModel(logger,config)
     notifiermodel = NotifierModel(logger,config)
     puncher = Puncher(logger,targetmodel,notifiermodel)
     try:
         while True:
             ids = targetmodel.get_ids()
             for id in ids:
                 target = targetmodel.get(id)
                 if target.enabled:
                     puncher.punch(target)
             time.sleep(config.getint(skypunchconfig.SETTINGS,skypunchconfig.MAINLOOPTOV))
     except SystemExit, e:
         sys.exit(e)
Ejemplo n.º 4
0
 def run(self):
     print 'starting %s ....' % PROGNAME
     logger.info('starting %s ....' % PROGNAME)
     config = SkyPunchConfig(logger)
     targetmodel = TargetModel(logger, config)
     notifiermodel = NotifierModel(logger, config)
     puncher = Puncher(logger, targetmodel, notifiermodel)
     try:
         while True:
             ids = targetmodel.get_ids()
             for id in ids:
                 target = targetmodel.get(id)
                 if target.enabled:
                     puncher.punch(target)
             time.sleep(
                 config.getint(skypunchconfig.SETTINGS,
                               skypunchconfig.MAINLOOPTOV))
     except SystemExit, e:
         sys.exit(e)