def __getitem__(self,x): """ Get a job by positional index. Examples: jobs[-1] : get last job, jobs[0] : get first job, jobs[1] : get second job. """ return _wrap(self._impl.__getitem__(_unwrap(x)))
def __call__(self,x): """ Access individual job. Examples: jobs(10) : get job with id 10 or raise exception if it does not exist. jobs((10,2)) : get subjobs number 2 of job 10 if exist or raise exception. jobs('10.2')) : same as above """ return _wrap(self._impl.__call__(x))
def __getitem__(self,x): """ Get an item by positional index. Examples: box[-1] : get last object, box[0] : get first object, box[1] : get second object. """ return _wrap(self._impl.__getitem__(x))
def jobSlice(joblist): """create a 'JobSlice' from a list of jobs example: jobSlice([j for j in jobs if j.name.startswith("T1:")])""" slice = JobRegistrySlice("manual slice") slice.objects = oDict([(j.fqid, _unwrap(j)) for j in joblist]) return _wrap(slice)
def __getslice__(self, i1,i2): """ Get a slice. Examples: jobs[2:] : get first two jobs, jobs[-10:] : get last 10 jobs. """ return _wrap(self._impl.__getslice__(i1,i2))
def __getslice__(self, i1,i2): """ Get a slice. Examples: box[2:] : get first two objects, box[:-10] : get last 10 objects. """ return _wrap(self._impl.__getslice__(i1,i2))
def __call__(self,x): """ Access individual object. Examples: box(10) : get object with id 10 or raise exception if it does not exist. """ return _wrap(self._impl.__call__(x))