|
|
@ -2,6 +2,7 @@
|
|
|
|
from __future__ import (absolute_import, division, print_function,
|
|
|
|
from __future__ import (absolute_import, division, print_function,
|
|
|
|
unicode_literals)
|
|
|
|
unicode_literals)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import types
|
|
|
|
import inspect
|
|
|
|
import inspect
|
|
|
|
import warnings
|
|
|
|
import warnings
|
|
|
|
from functools import partial
|
|
|
|
from functools import partial
|
|
|
@ -107,6 +108,8 @@ class Job(object):
|
|
|
|
raise TypeError('{0!r} is not a valid args list.'.format(args))
|
|
|
|
raise TypeError('{0!r} is not a valid args list.'.format(args))
|
|
|
|
if not isinstance(kwargs, dict):
|
|
|
|
if not isinstance(kwargs, dict):
|
|
|
|
raise TypeError('{0!r} is not a valid kwargs dict.'.format(kwargs))
|
|
|
|
raise TypeError('{0!r} is not a valid kwargs dict.'.format(kwargs))
|
|
|
|
|
|
|
|
if not isinstance(job_id, (str, unicode, types.NoneType)):
|
|
|
|
|
|
|
|
raise TypeError('job_id must be a str/unicode, not {}.'.format(type(job_id)))
|
|
|
|
|
|
|
|
|
|
|
|
job = cls(connection=connection)
|
|
|
|
job = cls(connection=connection)
|
|
|
|
if job_id is not None:
|
|
|
|
if job_id is not None:
|
|
|
@ -329,11 +332,7 @@ class Job(object):
|
|
|
|
|
|
|
|
|
|
|
|
def set_id(self, value):
|
|
|
|
def set_id(self, value):
|
|
|
|
"""Sets a job ID for the given job."""
|
|
|
|
"""Sets a job ID for the given job."""
|
|
|
|
try:
|
|
|
|
self._id = value
|
|
|
|
self.key_for(text_type(value))
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
raise ValueError("Job ID invalid, failed to encode to string")
|
|
|
|
|
|
|
|
self._id = text_type(value)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
id = property(get_id, set_id)
|
|
|
|
id = property(get_id, set_id)
|
|
|
|
|
|
|
|
|
|
|
|