コード例 #1
0
ファイル: JobRegistry.py プロジェクト: wvengen/lgipilot
 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)))
コード例 #2
0
ファイル: JobRegistry.py プロジェクト: wvengen/lgipilot
 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))
コード例 #3
0
ファイル: BoxRegistry.py プロジェクト: wvengen/lgipilot
 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))
コード例 #4
0
ファイル: JobRegistry.py プロジェクト: wvengen/lgipilot
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)
コード例 #5
0
ファイル: JobRegistry.py プロジェクト: wvengen/lgipilot
 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))
コード例 #6
0
ファイル: BoxRegistry.py プロジェクト: wvengen/lgipilot
 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))
コード例 #7
0
ファイル: BoxRegistry.py プロジェクト: wvengen/lgipilot
 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))