1616# Logging
1717# ---------------------------------------------------------------------------
1818
19+
1920def _get_log_dir ():
2021 """Get user-scoped log directory with restrictive permissions."""
2122 try :
@@ -51,6 +52,7 @@ def log(component, message):
5152# Directory discovery
5253# ---------------------------------------------------------------------------
5354
55+
5456def find_entities_dir ():
5557 """Locate the entities directory.
5658
@@ -98,6 +100,7 @@ def get_default_entities_dir():
98100# Slugify / filename helpers
99101# ---------------------------------------------------------------------------
100102
103+
101104def slugify (text , max_length = 60 ):
102105 """Convert *text* to a filesystem-safe slug.
103106
@@ -207,8 +210,8 @@ def markdown_to_entity(path):
207210 body = body .strip ()
208211 m = re .search (r"^## Rationale" , body , re .MULTILINE )
209212 if m :
210- content = body [:m .start ()].strip ()
211- rationale = body [m .end ():].strip ()
213+ content = body [: m .start ()].strip ()
214+ rationale = body [m .end () :].strip ()
212215 if rationale :
213216 entity ["rationale" ] = rationale
214217 else :
@@ -224,6 +227,7 @@ def markdown_to_entity(path):
224227# Bulk load / write
225228# ---------------------------------------------------------------------------
226229
230+
227231def load_all_entities (entities_dir ):
228232 """Glob ``**/*.md`` under *entities_dir* and parse each file.
229233
0 commit comments