예제 #1
0
 def __getitem__(self, x):
     """ Get a job by positional index. Examples:
     tasks[-1] : get last job,
     tasks[0] : get first job,
     tasks[1] : get second job.
     """
     return _wrap(stripProxy(self).__getitem__(_unwrap(x)))
예제 #2
0
 def __getitem__(self, x):
     """ Get a job by positional index. Examples:
     tasks[-1] : get last job,
     tasks[0] : get first job,
     tasks[1] : get second job.
     """
     return _wrap(stripProxy(self).__getitem__(_unwrap(x)))
예제 #3
0
 def select(self, minid=None, maxid=None, **attrs):
     """ Select a subset of tasks. Examples:
     tasks.select(10): select tasks with ids higher or equal to 10;
     tasks.select(10,20) select tasks with ids in 10,20 range (inclusive);
     tasks.select(status='completed') select all tasks with status completed;
     tasks.select(name='some') select all tasks with some name;
     """
     unwrap_attrs = {}
     for a in attrs:
         unwrap_attrs[a] = _unwrap(attrs[a])
     return TaskRegistrySliceProxy(stripProxy(self).select(minid, maxid, **unwrap_attrs))
예제 #4
0
 def select(self, minid=None, maxid=None, **attrs):
     """ Select a subset of tasks. Examples:
     tasks.select(10): select tasks with ids higher or equal to 10;
     tasks.select(10,20) select tasks with ids in 10,20 range (inclusive);
     tasks.select(status='completed') select all tasks with status completed;
     tasks.select(name='some') select all tasks with some name;
     """
     unwrap_attrs = {}
     for a in attrs:
         unwrap_attrs[a] = _unwrap(attrs[a])
     return TaskRegistrySliceProxy(
         stripProxy(self).select(minid, maxid, **unwrap_attrs))