MCPcopy
hub / github.com/Textualize/rich / make_filename_text

Function make_filename_text

examples/listdir.py:22–27  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

20else:
21
22 def make_filename_text(filename):
23 path = os.path.abspath(os.path.join(root_path, filename))
24 text = Text(filename, style="bold blue" if os.path.isdir(path) else "default")
25 text.stylize(f"link file://{path}")
26 text.highlight_regex(r"\..*?$", "bold")
27 return text
28
29 filenames = [
30 filename for filename in os.listdir(root_path) if not filename.startswith(".")

Callers 1

listdir.pyFile · 0.85

Calls 4

stylizeMethod · 0.95
highlight_regexMethod · 0.95
TextClass · 0.90
joinMethod · 0.80

Tested by

no test coverage detected