Exemplo n.º 1
0
 def scheduleUpdater(self):
     if not config.dev_mode():
         updaterCheck()
         self.updaterPeriod = config.get_setting('addon_update_timer')
         schedule.every(
             self.updaterPeriod).hours.do(updaterCheck).tag('updater')
         logger.debug('scheduled updater every ' + str(self.updaterPeriod) +
                      ' hours')
Exemplo n.º 2
0
 def scheduleVideolibrary(self):
     self.update_setting = config.get_setting("update", "videolibrary")
     # 2= daily 3=daily and when kodi starts
     if self.update_setting == 2 or self.update_setting == 3:
         self.update_hour = config.get_setting("everyday_delay",
                                               "videolibrary") * 4
         schedule.every().day.at(str(self.update_hour).zfill(2) + ':00').do(
             run_threaded, check_for_update, (False, )).tag('videolibrary')
         logger.debug('scheduled videolibrary at ' +
                      str(self.update_hour).zfill(2) + ':00')
Exemplo n.º 3
0
def main():
    # Coloca na agenda a rotina 1 - Carregamento e trabalhos
    schedule.every(1).day.do(loadTasks).run()

    # Carrega rotina principal na mermoria de exec 
    worker_thread = threading.Thread(target=worker_main)
    worker_thread.start()

    while True:
        schedule.run_pending()
        time.sleep(1)
Exemplo n.º 4
0
    def __init__(self, id):

        self.id = id
        
        path = os.path.join(os.getcwd(),"data")
        self.configFile = os.path.join(path, id + ".cfg")

        config = configparser.ConfigParser()
        
        if os.path.isfile(self.configFile):     
            config.read(self.configFile)
            config_last_run = datetime.strptime(config['Job']['last_run'],'%d/%m/%Y %H:%M')
            
        else:
            config_last_run = ''
            config['Job'] = {}
            config['Job']['last_run'] = ''
            with open(self.configFile, 'w') as configfile:
                config.write(configfile)
       
        self.config = config

        self.scheduleJob = schedule.every().tag(id)

        if config_last_run:
           self.scheduleJob.last_run = config_last_run 
Exemplo n.º 5
0
 def scheduleScreenOnJobs(self):
     schedule.every().second.do(viewmodeMonitor).tag('screenOn')
     schedule.every().second.do(torrent.elementum_monitor).tag('screenOn')
Exemplo n.º 6
0
 def scheduleUA(self):
     get_ua_list()
     schedule.every(1).day.do(get_ua_list)
Exemplo n.º 7
0
 def on_init(self, **kwargs):
     schedule.every().day.at("03:00").do(self.turn_off)
     schedule.every().day.at("06:30").do(self.turn_on)
     # schedule.every(10).seconds.do(self.turn_off)
     # schedule.every(10).seconds.do(self.turn_on)
     schedule.run_continuously()
Exemplo n.º 8
0
 def create_sensor_job(self, job_function, sensor_id, sensor_type=1):
     
     jobObj = schedule.every(self.interval).minutes
     jobObj.do(self.run_threaded, job_function, sensor_id, sensor_type)