#### This file contains a bunch of trace tables that I think relate to #### a discarded version of Topic.__makeDirs(). If PyStyler works, #### this file can be discarded. # - - - T o p i c . _ _ m a k e D i r s - - - #### Case 1: All directories in path exist #-- 1 -- # [ dirList := a list of strings [S0, S1, ..., SN] such that # path == (S0 + "/" + S1 + "/" + ... + "/" + SN + "/" + F) # and none of the Si nor F contain "/" ] dirList: list [S0, S1, ..., SN] split on "/" from path, minus last component #-- 2 -- # [ if all nonempty directory names in the sequence [S0, S0+"/"+S1, # S0+"/"+S1+"/"+S2, ...] exist -> # I # else if all the nonexistent directories in that sequence # can be created in order -> # create those directories # else -> # Log() +:= error message(s) # return 0 ] dirList: list [S0, S1, ..., SN] split on "/" from path, minus last component #-- 3 -- return 1 return 1 #-- TARGET -- [ if path is a string -> if all nonexistent directories in self's path can be created top to bottom -> create those directories return 1 else -> Log() +:= error message(s) return 0 ] # - - - T o p i c . _ _ m a k e D i r s - - - #### Case 2: (not all directories in path exist) and (we can create #### the ones that don't exist) #-- 1 -- # [ dirList := a list of strings [S0, S1, ..., SN] such that # path == (S0 + "/" + S1 + "/" + ... + "/" + SN + "/" + F) # and none of the Si nor F contain "/" ] dirList: list [S0, S1, ..., SN] split on "/" from path, minus last component #-- 2 -- # [ if all nonempty directory names in the sequence [S0, S0+"/"+S1, # S0+"/"+S1+"/"+S2, ...] exist -> ... # else if all the nonexistent directories in that sequence # can be created in order -> # create those directories # else -> ... ] dirList: list [S0, S1, ..., SN] split on "/" from path, minus last component create all nonexistent directories with nonempty names in sequence [S0, S0+"/"+S1, S0+"/"+S1+"/"+S2, ...] #-- 3 -- return 1 dirList: list [S0, S1, ..., SN] split on "/" from path, minus last component create all nonexistent directories with nonempty names in sequence [S0, S0+"/"+S1, S0+"/"+S1+"/"+S2, ...] return 1 #-- TARGET -- OK [ if path is a string -> if all directories in self's path exist -> ... else if all nonexistent directories in self's path can be created top to bottom -> create those directories return 1 else -> ... ] # - - - T o p i c . _ _ m a k e D i r s - - - #### Case 3: (not all directories in path exist) and #### (we cannot create all the ones that don't exist) #-- 1 -- # [ dirList := a list of strings [S0, S1, ..., SN] such that # path == (S0 + "/" + S1 + "/" + ... + "/" + SN + "/" + F) # and none of the Si nor F contain "/" ] dirList: list [S0, S1, ..., SN] split on "/" from path, minus last component #-- 2 -- # [ if all nonempty directory names in the sequence [S0, S0+"/"+S1, # S0+"/"+S1+"/"+S2, ...] exist -> # I # else if all the nonexistent directories in that sequence # can be created in order -> # create those directories # else -> # possibly create some of those directories # Log() +:= error message(s) # return 0 ] dirList: list [S0, S1, ..., SN] split on "/" from path, minus last component possibly create some directories on path Log(): @+(err msg(s)) return 0 #-- TARGET -- OK [ if path is a string -> if all directories in self's path exist -> ... else if all nonexistent directories in self's path can be created top to bottom -> ... else -> possibly create some of those directories Log() +:= error message(s) return 0 ] # - - - T o p i c . _ _ m a k e D i r s - - - #### Definite iteration, empty case: dirList is empty relPath: "" sep: "" #-- TARGET -- OK # [ if all nonempty directory names in the sequence [S0, S0+"/"+S1, # S0+"/"+S1+"/"+S2, ...] exist -> (where Si===dirList[i]) # I # else if all the nonexistent directories in that sequence # can be created in order -> # create those directories # else -> ... ] # - - - T o p i c . _ _ m a k e D i r s - - - #### Definite iteration, case 1: #### (dirList[0] is "") and (remaining directories exist or can be created) relPath: "" sep: "" dir: dirList[0] #-- 2 body -- # [ if ((relPath+sep+dir) is "") # or ((relPath+sep+dir) names an existing directory) -> # relPath := relPath+sep+dir # sep := "/" # else if (relPath+"/"+dir) names a directory that # can be created -> # create that directory # relPath := relPath+sep+dir # sep := "/" # else -> # Log() +:= error message(s) # return 0 ] relPath: "" sep: "/" dir: dirList[0] #-- 2 -- # [ if all nonempty directory names in the sequence # [dirList[0]+"/"+dirList[1], # dirList[0]+"/"+dirList[1]+"/"+dirList[2], ...] exist -> # I # else if all the nonexistent directories in that sequence # can be created in order -> # create those directories # else -> # possibly create some of those directories # Log() +:= error message(s) # return 0 ] create any nonexistent directories in that sequence #-- TARGET -- OK # [ if all nonempty directory names in the sequence # [dirList[0], dirList[0]+"/"+dirList[1], # dirList[0]+"/"+dirList[1]+"/"+dirList[2], ...] exist -> # I # else if all the nonexistent directories in that sequence # can be created in order -> # create those directories # else -> # possibly create some of those directories # Log() +:= error message(s) # return 0 ] # - - - T o p i c . _ _ m a k e D i r s - - - #### Definite iteration, true case 2: #### (dirList[0] is "") and (there are remaining directories that #### don't exist and can't be created) relPath: "" sep: "" dir: dirList[0]