MCPcopy Create free account
hub / github.com/numpy/numpy / iter_included_files

Function iter_included_files

tools/refguide_check.py:1032–1066  ·  view source on GitHub ↗

Generator function to walk `base_path` and its subdirectories, skipping files or directories in RST_SKIPLIST, and yield each file with a suffix in `suffixes` Parameters ---------- base_path : str Base path of the directory to be processed verbose : int suff

(base_path, verbose=0, suffixes=('.rst',))

Source from the content-addressed store, hash-verified

1030
1031
1032def iter_included_files(base_path, verbose=0, suffixes=('.rst',)):
1033 """
1034 Generator function to walk `base_path` and its subdirectories, skipping
1035 files or directories in RST_SKIPLIST, and yield each file with a suffix in
1036 `suffixes`
1037
1038 Parameters
1039 ----------
1040 base_path : str
1041 Base path of the directory to be processed
1042 verbose : int
1043
1044 suffixes : tuple
1045
1046 Yields
1047 ------
1048 path
1049 Path of the directory and its sub directories
1050 """
1051 if os.path.exists(base_path) and os.path.isfile(base_path):
1052 yield base_path
1053 for dir_name, subdirs, files in os.walk(base_path, topdown=True):
1054 if dir_name in RST_SKIPLIST:
1055 if verbose > 0:
1056 sys.stderr.write('skipping files in %s' % dir_name)
1057 files = []
1058 for p in RST_SKIPLIST:
1059 if p in subdirs:
1060 if verbose > 0:
1061 sys.stderr.write('skipping %s and subdirs' % p)
1062 subdirs.remove(p)
1063 for f in files:
1064 if (os.path.splitext(f)[1] in suffixes and
1065 f not in RST_SKIPLIST):
1066 yield os.path.join(dir_name, f)
1067
1068
1069def check_documentation(base_path, results, args, dots):

Callers 1

check_documentationFunction · 0.85

Calls 3

existsMethod · 0.45
writeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected