dbader / schedule

Python job scheduling for humans.
https://schedule.readthedocs.io/
MIT License
11.73k stars 960 forks source link

Requesting of how to parse or leverage the object (list) returned from get_jobs()? #480

Open dachshund-digital opened 3 years ago

dachshund-digital commented 3 years ago

Requesting of how to parse or leverage the object (list) returned from get_jobs()? I am not using tags, just want to be able to understand and use the object (list) returned by get_jobs()? Say, now to walk the get_jobs() returned list, getting the 'name' of each job or the 'name' attached callback function for the given job?

rocky4546 commented 3 years ago

Have you tried calling get_jobs() without a parameter? Code looks like it will return the full list of job objects that you can traverse. As for a name, jobs by default do not have a "name". I use the self.job_func.args field in the jobs object to contain a dict object containing a host of information including a uuid and name, but that is my implementation. You can use the args field anyway you need. If you want the function being called, you can use self.job_func.name. See the method in the Job object called str(self) for more information.

dachshund-digital commented 3 years ago

Yes, I can get jobs returned... BUT AS I REQUESTED... I can't see to get how to parse out or use the list. It is NOT a simple list per se or even a dict. The format escapes my understanding. And NO WHERE it seems, can I find an example of someone actually showing how to parse the results. IS NOT my question, request not clear? "Requesting of how to parse or leverage the object (list) returned from get_jobs()?"