| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -222,14 +222,14 @@ def _add(str, fn): | |||
| 222 | 222 | def makedirs(name, mode=0o777, exist_ok=False, *, parent_mode=None): | |
| 223 | 223 | """makedirs(name [, mode=0o777][, exist_ok=False][, parent_mode=None]) | |
| 224 | 224 | ||
| 225 | - Super-mkdir; create a leaf directory and all intermediate ones. Works like | ||
| 226 | - mkdir, except that any intermediate path segment (not just the rightmost) | ||
| 227 | - will be created if it does not exist. If the target directory already | ||
| 228 | - exists, raise an OSError if exist_ok is False. Otherwise no exception is | ||
| 229 | - raised. If parent_mode is not None, it will be used as the mode for any | ||
| 230 | - newly-created, intermediate-level directories. Otherwise, intermediate | ||
| 231 | - directories are created with the default permissions (respecting umask). | ||
| 232 | - This is recursive. | ||
| 225 | + Super-mkdir; create a leaf directory and all intermediate ones. Works | ||
| 226 | + like mkdir, except that any intermediate path segment (not just the | ||
| 227 | + rightmost) will be created if it does not exist. If the target | ||
| 228 | + directory already exists, raise an OSError if exist_ok is False. | ||
| 229 | + Otherwise no exception is raised. If parent_mode is not None, it will | ||
| 230 | + be used as the mode for any newly-created, intermediate-level | ||
| 231 | + directories. Otherwise, intermediate directories are created with the | ||
| 232 | + default permissions (respecting umask). This is recursive. | ||
| 233 | 233 | ||
| 234 | 234 | """ | |
| 235 | 235 | head, tail = path.split(name) | |
@@ -321,12 +321,12 @@ def walk(top, topdown=True, onerror=None, followlinks=False): | |||
| 321 | 321 | dirpath, dirnames, filenames | |
| 322 | 322 | ||
| 323 | 323 | dirpath is a string, the path to the directory. dirnames is a list of | |
| 324 | - the names of the subdirectories in dirpath (including symlinks to directories, | ||
| 325 | - and excluding '.' and '..'). | ||
| 324 | + the names of the subdirectories in dirpath (including symlinks to | ||
| 325 | + directories, and excluding '.' and '..'). | ||
| 326 | 326 | filenames is a list of the names of the non-directory files in dirpath. | |
| 327 | - Note that the names in the lists are just names, with no path components. | ||
| 328 | - To get a full path (which begins with top) to a file or directory in | ||
| 329 | - dirpath, do os.path.join(dirpath, name). | ||
| 327 | + Note that the names in the lists are just names, with no path | ||
| 328 | + components. To get a full path (which begins with top) to a file or | ||
| 329 | + directory in dirpath, do os.path.join(dirpath, name). | ||
| 330 | 330 | ||
| 331 | 331 | If optional arg 'topdown' is true or not specified, the triple for a | |
| 332 | 332 | directory is generated before the triples for any of its subdirectories | |
@@ -336,13 +336,13 @@ def walk(top, topdown=True, onerror=None, followlinks=False): | |||
| 336 | 336 | ||
| 337 | 337 | When topdown is true, the caller can modify the dirnames list in-place | |
| 338 | 338 | (e.g., via del or slice assignment), and walk will only recurse into the | |
| 339 | - subdirectories whose names remain in dirnames; this can be used to prune the | ||
| 340 | - search, or to impose a specific order of visiting. Modifying dirnames when | ||
| 341 | - topdown is false has no effect on the behavior of os.walk(), since the | ||
| 342 | - directories in dirnames have already been generated by the time dirnames | ||
| 343 | - itself is generated. No matter the value of topdown, the list of | ||
| 344 | - subdirectories is retrieved before the tuples for the directory and its | ||
| 345 | - subdirectories are generated. | ||
| 339 | + subdirectories whose names remain in dirnames; this can be used to prune | ||
| 340 | + the search, or to impose a specific order of visiting. Modifying | ||
| 341 | + dirnames when topdown is false has no effect on the behavior of | ||
| 342 | + os.walk(), since the directories in dirnames have already been generated | ||
| 343 | + by the time dirnames itself is generated. No matter the value of | ||
| 344 | + topdown, the list of subdirectories is retrieved before the tuples for | ||
| 345 | + the directory and its subdirectories are generated. | ||
| 346 | 346 | ||
| 347 | 347 | By default errors from the os.scandir() call are ignored. If | |
| 348 | 348 | optional arg 'onerror' is specified, it should be a function; it | |
@@ -469,9 +469,9 @@ def fwalk(top=".", topdown=True, onerror=None, *, follow_symlinks=False, dir_fd= | |||
| 469 | 469 | The advantage of fwalk() over walk() is that it's safe against symlink | |
| 470 | 470 | races (when follow_symlinks is False). | |
| 471 | 471 | ||
| 472 | - If dir_fd is not None, it should be a file descriptor open to a directory, | ||
| 473 | - and top should be relative; top will then be relative to that directory. | ||
| 474 | - (dir_fd is always supported for fwalk.) | ||
| 472 | + If dir_fd is not None, it should be a file descriptor open to | ||
| 473 | + a directory, and top should be relative; top will then be relative to | ||
| 474 | + that directory. (dir_fd is always supported for fwalk.) | ||
| 475 | 475 | ||
| 476 | 476 | Caution: | |
| 477 | 477 | Since fwalk() yields file descriptors, those are only valid until the | |
| Back | FazBrowse Home | New Git URL |
0 commit comments