nephos.scheduler
index
/media/hdd/Essentials/Chapter_Kgp_WOrk/GSoC/projectnephos_gsoc18/GSoC18Nephos/nephos/scheduler.py

All scheduler tasks go here.

 
Modules
       
os

 
Classes
       
builtins.object
Scheduler

 
class Scheduler(builtins.object)
    A class to rule all the scheduling related tasks.
 
  Methods defined here:
__init__(self, main)
initialise Scheduler with basic configuration
 
Parameters
----------
main
    type: bool
    whether the initiated scheduler is the nephos's scheduler or not
add_cron_necessary_job(self, func, main_id, job_time, repetition='1111111', args=None)
Parameters
----------
func
    type: callable
    maintenance function to be run at the execution of the job
main_id
    type: str
    unique id to be associated with the job
job_time
    type: str
    time at which job is to be executed, eg "15:45"
repetition
    type: str
    days of week on which uploading is to take place
args
    type: list
    list of arguments for the function
 
Returns
-------
add_necessary_job(self, func, main_id, interval, args=None)
Add necessary jobs to the scheduler
 
Parameters
----------
func
    type: callable
    maintenance function to be run at the execution of the job
main_id
    type: str
    unique id to be associated with the job
interval
    type: int
    repetition interval in minutes
args
    type: list or tuple
    list of positional arguments to call func with
 
Returns
-------
add_recording_job(self, ip_addr, out_path, duration, job_time, week_days, job_name)
Add recording jobs to the scheduler
 
Parameters
----------
ip_addr
    type: str
    ip address of the channel
out_path
    type: str
    path, without ".ts", where the file is to the saved
duration
    type: int
    duration in minutes for the job to run
job_time
    type: HH:MM
    time to begin the job
week_days
    type: str
    contains the details for which week days the job is to run
job_name
    type: str
    name of the job, unique
 
Returns
-------
get_jobs(self)
prints a formatted list of jobs, their triggers and next run times
 
Returns
-------
type: list
list of jobs
rm_recording_job(self, job_id)
delete a recording job from schedule
 
Parameters
-------
job_id
    type: str
    name of the job
 
Returns
-------
shutdown(self)
shutdown scheduler after completing running jobs
 
Returns
-------
start(self)
Starts the scheduler
Returns
-------

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Data
        LOG = <logging.Logger object>
MAX_CONCURRENT_JOBS = 20
PATH_JOB_DB = '/home/thealpha/Nephos/databases/jobs.db'
TMZ = <DstTzInfo 'Asia/Kolkata' HMT+5:53:00 STD>
__nephos_dir__ = '/home/thealpha/Nephos'