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

Function star_output

scripts/python_ui/streamlit.py:682–713  ·  view source on GitHub ↗

Star/favorite an output log. Args: log_index: Index of the output log to star custom_name: Optional custom name for the starred output Returns: bool: True if output was starred successfully, False otherwise

(log_index: int, custom_name: str = "")

Source from the content-addressed store, hash-verified

680
681
682def star_output(log_index: int, custom_name: str = "") -> bool:
683 """Star/favorite an output log.
684
685 Args:
686 log_index: Index of the output log to star
687 custom_name: Optional custom name for the starred output
688
689 Returns:
690 bool: True if output was starred successfully, False otherwise
691 """
692 try:
693 if 0 <= log_index < len(st.session_state.output_logs):
694 log_entry = st.session_state.output_logs[log_index].copy()
695 log_entry["is_starred"] = True
696 log_entry["custom_name"] = (
697 custom_name
698 or f"Starred Output #{len(st.session_state.starred_outputs) + 1}"
699 )
700
701 # Check if this output is already starred (by timestamp)
702 if not any(
703 s["timestamp"] == log_entry["timestamp"]
704 for s in st.session_state.starred_outputs
705 ):
706 st.session_state.starred_outputs.append(log_entry)
707 save_outputs() # Save after starring
708 return True
709
710 return False
711 except Exception as e:
712 logger.error(f"Error starring output: {str(e)}")
713 return False
714
715
716def unstar_output(log_index: int):

Callers 1

handle_star_name_inputFunction · 0.85

Calls 1

save_outputsFunction · 0.85

Tested by

no test coverage detected