Retrieve (book-on-demand) 'Smart'-N-tuple object.
Retrieve 'Smart'-N-tuple object.
N-tuple is booked on-demand.
Atetntion !!
The logical unit LUN must be configured by N-Tuple Service
Retrieve (book-n-demand) N-Tuple using
the directory name and the title:
>>> t = nTuple ( 'the/path/to/directory' , ## the path to the directory
'N-tuple title' , ## the title for N-Tuple
LUN = 'FILE1' ) ## logical file unit
Retrieve (book-n-demand) N-Tuple using
the directory name, literal ID and the title:
>>> t = nTuple ( 'the/path/to/directory' , ## the path to the directory
'Tuple1' , ## the literal ID for N-Tuple
'N-tuple title' , ## the title for N-Tuple
LUN = 'FILE1' ) ## logical file unit
Retrieve (book-n-demand) N-Tuple using
the directory name, numerical ID and the title:
>>> t = nTuple ( 'the/path/to/directory' , ## the path to the directory
124 , ## the numerical ID for N-Tuple
'N-tuple title' , ## the title for N-Tuple
LUN = 'FILE1' ) ## logical file unit
Definition at line 65 of file TupleUtils.py.
65 def nTuple ( dirpath , ID , ID2 = None , topdir = None , LUN = 'FILE1' ) :
67 Retrieve 'Smart'-N-tuple object. 68 N-tuple is booked on-demand. 71 The logical unit LUN must be configured by N-Tuple Service 73 Retrieve (book-n-demand) N-Tuple using 74 the directory name and the title: 75 >>> t = nTuple ( 'the/path/to/directory' , ## the path to the directory 76 'N-tuple title' , ## the title for N-Tuple 77 LUN = 'FILE1' ) ## logical file unit 79 Retrieve (book-n-demand) N-Tuple using 80 the directory name, literal ID and the title: 81 >>> t = nTuple ( 'the/path/to/directory' , ## the path to the directory 82 'Tuple1' , ## the literal ID for N-Tuple 83 'N-tuple title' , ## the title for N-Tuple 84 LUN = 'FILE1' ) ## logical file unit 86 Retrieve (book-n-demand) N-Tuple using 87 the directory name, numerical ID and the title: 88 >>> t = nTuple ( 'the/path/to/directory' , ## the path to the directory 89 124 , ## the numerical ID for N-Tuple 90 'N-tuple title' , ## the title for N-Tuple 91 LUN = 'FILE1' ) ## logical file unit 95 toolSvc = _getToolSvc ()
98 name =
'Tuple'+LUN+
"/" 99 if topdir : name += topdir
102 if ID2 : name +=
"_%s"%ID2
103 name=name.replace (
'.' ,
'_' )
104 name=name.replace (
'/' ,
'_' )
105 name=name.replace (
'\\' ,
'_' )
106 name=name.replace (
' ' ,
'_' )
112 t0.NTupleDir = dirpath
113 t0.PropertiesPrint =
False 115 if topdir : t0.NTupleTopDir = topdir
118 tool = toolSvc.create (
'TupleTool' ,
124 if t1.NTupleLUN != LUN : t1.NTupleLUN = LUN
125 if t1.NTupleDir != dirpath : t1.NTupleDir = dirpath
126 if topdir
and ( t1.NTupleTopDir != topdir ) :
127 t1.NTupleTopDir = topdir
129 _TOOLS_.append ( tool )
130 if not ID2 :
return tool.nTuple ( ID )
132 return tool.nTuple ( ID , ID2 )
def nTuple(dirpath, ID, ID2=None, topdir=None, LUN='FILE1')
Retrieve (book-on-demand) 'Smart'-N-tuple object.