MCPcopy Create free account
hub / github.com/Image-Py/imagepy / build_document

Function build_document

imagepy/core/loader/loader.py:242–252  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

240 return (pg, subtree)
241
242def build_document(path):
243 docs = []
244 for dirpath,dirnames,filenames in os.walk(path):
245 for filename in filenames:
246 if filename[-3:] != '.md': continue
247 docs.append(os.path.join(dirpath, filename))
248 f = open(docs[-1], encoding='utf-8')
249 cont = f.read()
250 f.close()
251 DocumentManager.add(filename[:-3], cont)
252 return docs
253
254if __name__ == "__main__":
255 print (os.getcwd())

Callers

nothing calls this directly

Calls 4

appendMethod · 0.80
readMethod · 0.45
closeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected