MCPcopy Create free account
hub / github.com/danielmiessler/Fabric / get_patterns

Function get_patterns

scripts/python_ui/streamlit.py:355–372  ·  view source on GitHub ↗

Get the list of available patterns from the specified directory.

()

Source from the content-addressed store, hash-verified

353
354
355def get_patterns():
356 """Get the list of available patterns from the specified directory."""
357 if not os.path.exists(pattern_dir):
358 st.error(f"Pattern directory not found: {pattern_dir}")
359 return []
360 try:
361 patterns = [
362 item
363 for item in os.listdir(pattern_dir)
364 if os.path.isdir(os.path.join(pattern_dir, item))
365 ]
366 return patterns
367 except PermissionError:
368 st.error(f"Permission error accessing pattern directory: {pattern_dir}")
369 return []
370 except Exception as e:
371 st.error(f"An unexpected error occurred: {e}")
372 return []
373
374
375def create_pattern(

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected