UseCases.FileSysObjects.branches.iteratePathElements package¶
Submodules¶
UseCases.FileSysObjects.branches.iteratePathElements.CallCase module¶
Create a plist, find side branches with slices of multi-node hooks.
- E.g. the branch ‘a/b0/F[0-7]*’, which maps the slice ‘a/b0’ and extends at ‘a/b0’ by ‘glob’
testdata.mypath+/examples/a/b0/c/a/b0/c __________________________a/b0/ ______________________________`--F[0-7]*
- resulting in:
testdata.mypath+'/examples/a/b0/c/a/new/branch'
Data:
see 'testdata.examples'
refer also to the manual [filesystem-elements-as-objects]
Call:
# 1. search and create a path for a side branch sp = os.path.normpath('c/a/new/branch') rp = getTopFromPathString(sp,self._plist) # 2. search and create a path for a side branch - use the second plist entry sp = os.path.normpath('b0/c/new/branch') rp = getTopFromPathString(sp,self._plist,**{'matchidx':1}) # 3. search and create a path for a side branch - use the second plist entry + reverse the order sp = os.path.normpath('b0/c/new/branch') rp = getTopFromPathString(sp,self._plist,**{'matchidx':1,'reverse':True,}) # 4. search and create a path for a side branch - match a path entry with and use the second match within a path entry sp = os.path.normpath('b0/c/new/branch') rp = getTopFromPathString(sp,self._plist,**{'matchlvl':1,}) # 5. search and create a path for a side branch UPWARD - match a path entry with and use the second match within a path entry sp = os.path.normpath('b0/c/new/branch') rp = getTopFromPathString(sp,self._plist,**{'matchlvlupward':1,})
Result:
1. expected = os.path.normpath(testdata.mypath+'/examples/a/b0/c/a/new/branch') 2. expected = os.path.normpath(testdata.mypath+'/examples/a/b0/c/a/b0/c/new/branch') 3. expected = os.path.normpath(testdata.mypath+'/examples/a/b0/c/new/branch') 4. expected = os.path.normpath(testdata.mypath+'/examples/a/b0/c/a/b0/c/new/branch') 5. expected = os.path.normpath(testdata.mypath+'/examples/a/b0/c/new/branch')
-
class
UseCases.FileSysObjects.branches.iteratePathElements.CallCase.
UseCase
(*args, **kargs)[source]¶ Bases:
unittest.case.TestCase
-
testCase003a
()[source]¶ - search and create a path for a side branch - use the second plist entry + reverse the order
-
testCase003b
()[source]¶ - search and create a path for a side branch - use the second plist entry + reverse the order
-
testCase003c
()[source]¶ - search and create a path for a side branch - use the second plist entry + reverse the order
-
testCase003d
()[source]¶ - search and create a path for a side branch - use the second plist entry + reverse the order
-