MCPcopy Create free account
hub / github.com/microsoft/UFO / write

Method write

ufo/module/basic.py:82–95  ·  view source on GitHub ↗

Write message to file. :param message: Message to write

(self, message: str)

Source from the content-addressed store, hash-verified

80 pass
81
82 def write(self, message: str) -> None:
83 """
84 Write message to file.
85 :param message: Message to write
86 """
87 try:
88 with open(self.file_path, self.mode, encoding="utf-8") as f:
89 f.write(message)
90 if not message.endswith("\n"):
91 f.write("\n")
92 f.flush() # Ensure immediate write
93 except Exception as e:
94 # Fallback: at least try to print the error
95 print(f"Failed to write to file {self.file_path}: {e}")
96
97
98class BaseRound(ABC):

Callers 15

receive_fileMethod · 0.80
run_webui_modeFunction · 0.80
to_markdownMethod · 0.80
_log_request_dataMethod · 0.80
to_jsonMethod · 0.80
to_jsonMethod · 0.80
to_jsonMethod · 0.80
undoMethod · 0.80
_create_copied_fileMethod · 0.80
test_send_fileMethod · 0.80

Calls

no outgoing calls

Tested by 8

test_send_fileMethod · 0.64
to_jsonMethod · 0.64
to_jsonMethod · 0.64
to_jsonMethod · 0.64