Pythonic way to get information on a job/task.

General discussions and questions.
Post Reply
giel_4321
Posts: 22
Joined: Tue Aug 11, 2020 1:29 am

Pythonic way to get information on a job/task.

Post by giel_4321 »

How can I retrieve information on job or a task using python.

For example like current progress, how many tasks the job have, name of artist etc.
User avatar
timurhai
Site Admin
Posts: 911
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Pythonic way to get information on a job/task.

Post by timurhai »

Hi!

It is not documented, yet, sorry.

See this:
https://github.com/CGRU/cgru/blob/maste ... n/afcmd.py

You can use Python to send JSON objects:
https://cgru.readthedocs.io/en/latest/a ... i.html#get
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
giel_4321
Posts: 22
Joined: Tue Aug 11, 2020 1:29 am

Re: Pythonic way to get information on a job/task.

Post by giel_4321 »

Thanks Timur, found the way to get info about job.But i would also like to know how can i set job priority with job id.
User avatar
timurhai
Site Admin
Posts: 911
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Pythonic way to get information on a job/task.

Post by timurhai »

Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
giel_4321
Posts: 22
Joined: Tue Aug 11, 2020 1:29 am

Re: Pythonic way to get information on a job/task.

Post by giel_4321 »

Thanks again

Code: Select all


    def setPrioritybyId(self,jobId, priority, verbose=False):
        """Missing DocString

                :param jobId:
                :param str params:
                :param bool verbose:
                :return:
                """
        self.action = 'action'
        self.data['type'] = 'jobs'
        self.data['ids'] = [jobId]
        self.data['params'] = {'priority': priority}
        return self._sendRequest(verbose)

giel_4321
Posts: 22
Joined: Tue Aug 11, 2020 1:29 am

Re: Pythonic way to get information on a job/task.

Post by giel_4321 »

Is there any function i can call to get ETA or is there any equation?
User avatar
timurhai
Site Admin
Posts: 911
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Pythonic way to get information on a job/task.

Post by timurhai »

No.

GUIs calculate it manually, according to percentage and elapsed time.
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
Post Reply