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

Function get_patterns

scripts/python_ui/streamlit.py:356–373  ·  view source on GitHub ↗

Get the list of available patterns from the specified directory.

()

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected