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 66 of file TupleUtils.py.
67 def nTuple ( dirpath , ID , ID2 = None , topdir = None , LUN = 'FILE1' ) :
69 Retrieve 'Smart'-N-tuple object.
70 N-tuple is booked on-demand.
73 The logical unit LUN must be configured by N-Tuple Service
75 Retrieve (book-n-demand) N-Tuple using
76 the directory name and the title:
77 >>> t = nTuple ( 'the/path/to/directory' , ## the path to the directory
78 'N-tuple title' , ## the title for N-Tuple
79 LUN = 'FILE1' ) ## logical file unit
81 Retrieve (book-n-demand) N-Tuple using
82 the directory name, literal ID and the title:
83 >>> t = nTuple ( 'the/path/to/directory' , ## the path to the directory
84 'Tuple1' , ## the literal ID for N-Tuple
85 'N-tuple title' , ## the title for N-Tuple
86 LUN = 'FILE1' ) ## logical file unit
88 Retrieve (book-n-demand) N-Tuple using
89 the directory name, numerical ID and the title:
90 >>> t = nTuple ( 'the/path/to/directory' , ## the path to the directory
91 124 , ## the numerical ID for N-Tuple
92 'N-tuple title' , ## the title for N-Tuple
93 LUN = 'FILE1' ) ## logical file unit
97 toolSvc = _getToolSvc ()
100 name =
'Tuple'+LUN+
"/"
101 if topdir : name += topdir
104 if ID2 : name +=
"_%s"%ID2
105 name=name.replace (
'.' ,
'_' )
106 name=name.replace (
'/' ,
'_' )
107 name=name.replace (
'\\' ,
'_' )
108 name=name.replace (
' ' ,
'_' )
114 t0.NTupleDir = dirpath
115 t0.PropertiesPrint =
False
117 if topdir : t0.NTupleTopDir = topdir
120 tool = toolSvc.create (
'TupleTool' ,
126 if t1.NTupleLUN != LUN : t1.NTupleLUN = LUN
127 if t1.NTupleDir != dirpath : t1.NTupleDir = dirpath
128 if topdir
and ( t1.NTupleTopDir != topdir ) :
129 t1.NTupleTopDir = topdir
131 _TOOLS_.append ( tool )
132 if not ID2 :
return tool.nTuple ( ID )
134 return tool.nTuple ( ID , ID2 )