MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / load_glob

Function load_glob

core/context.py:84–99  ·  view source on GitHub ↗
(pattern)

Source from the content-addressed store, hash-verified

82 return f"[ERROR] {e}"
83
84def load_glob(pattern):
85 import glob
86 matches = glob.glob(pattern, recursive=True)
87 if not matches:
88 warning(f"No files matched: {pattern}")
89 return []
90 loaded = []
91 for m in matches:
92 p = Path(m)
93 if p.is_file():
94 r = load_file(str(p))
95 if not r.startswith("[ERROR]"):
96 loaded.append(str(p))
97 if loaded:
98 info(f"Loaded {len(loaded)} files matching '{pattern}'")
99 return loaded
100
101def load_directory(path, extensions=None, max_files=10):
102 default_exts = {".py",".js",".ts",".sh",".md",".json",

Callers

nothing calls this directly

Calls 5

warningFunction · 0.90
infoFunction · 0.90
load_fileFunction · 0.85
is_fileMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected