6
0

Job.py 571 B

12345678910111213141516171819202122
  1. from time import time
  2. from uuid import uuid1
  3. from pycs.database.Project import Project
  4. class Job:
  5. """
  6. wrapper class to track job data and progress
  7. """
  8. # pylint: disable=too-few-public-methods
  9. def __init__(self, project: Project, job_type: str, name: str):
  10. self.identifier = str(uuid1())
  11. self.project_id = project.identifier
  12. self.type = job_type
  13. self.name = name
  14. self.progress = 0
  15. self.created = int(time())
  16. self.updated = int(time())
  17. self.started = None
  18. self.finished = None