MCPcopy
hub / github.com/LawRefBook/Laws / get_laws

Function get_laws

scripts/database.py:114–134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112
113
114def get_laws():
115 bypass = ["scripts"]
116 base = Path("../")
117 ret = []
118 for file in base.glob("**/*.md"):
119 if "_index.md" == file.parts[-1]:
120 continue
121 file = file.relative_to("../")
122 folder = "/".join(file.parts[:-1])
123 if not folder:
124 continue
125 bypass_flag = False
126 for by in bypass:
127 if re.search(by, str(file)):
128 bypass_flag = True
129 break
130 if bypass_flag:
131 continue
132 d = (folder, file.parts[-1].replace(".md", ""))
133 ret.append(d)
134 return ret
135
136
137law_db = LawDatabase()

Callers 1

update_databaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected