def print_scheduler_info(self): if self.count % 100 == 0: self.count = 0 logging.info(" ========== Scheduling ==========") logging.info("-------- Geometry") logging.info("\t\t {} rows * {} cols".format( SchedulerState.get_rows(), SchedulerState.get_cols())) logging.info("-------- Disabled") logging.info("\t\t {}".format(SchedulerState.get_disabled())) logging.info("-------- Enable State") logging.info(SchedulerState.get_enable_state()) logging.info("-------- Is Frontage Up?") logging.info(SchedulerState.is_frontage_on()) logging.info("-------- Usable?") logging.info(SchedulerState.usable()) logging.info("-------- Current App") logging.info(SchedulerState.get_current_app()) logging.info('Forced App ? {}'.format( SchedulerState.get_forced_app())) logging.info("---------- Waiting Queue") logging.info(SchedulerState.get_user_app_queue()) if SchedulerState.get_enable_state() == 'scheduled': logging.info("---------- Scheduled ON") logging.info(SchedulerState.get_scheduled_on_time().strftime( "%d-%m-%Y %H:%M:%S UTC+00")) logging.info("---------- Scheduled OFF") logging.info(SchedulerState.get_scheduled_off_time().strftime( "%d-%m-%Y %H:%M:%S UTC+00")) logging.info("---------- TIME NOW") logging.info(datetime.datetime.now().strftime( "%d-%m-%Y %H:%M:%S UTC+00")) self.count += 1
def status(): c_app = SchedulerState.get_current_app() c_app_name = c_app.get('name', '') if c_app else '' on_time = SchedulerState.get_scheduled_on_time() if on_time is not None: on_time.isoformat() return jsonify(is_usable=SchedulerState.usable(), is_forced=SchedulerState.get_forced_app(), current_app=c_app_name, next_on_time=on_time, state=SchedulerState.get_enable_state(), current_time=datetime.datetime.utcnow().isoformat(), height=SchedulerState.get_rows(), width=SchedulerState.get_cols(), disabled=SchedulerState.get_disabled(), version=SchedulerState.get_version())
def update_geometry(self): SchedulerState.update_geometry(SchedulerState.get_rows(), SchedulerState.get_cols(), SchedulerState.get_disabled())