MCPcopy Create free account
hub / github.com/chatmail/core / set_file

Method set_file

python/src/deltachat/message.py:114–119  ·  view source on GitHub ↗

set file for this message from path and mime_type.

(self, path, mime_type=None)

Source from the content-addressed store, hash-verified

112 return from_dc_charpointer(lib.dc_msg_get_file(self._dc_msg))
113
114 def set_file(self, path, mime_type=None):
115 """set file for this message from path and mime_type."""
116 mtype = ffi.NULL if mime_type is None else as_dc_charpointer(mime_type)
117 if not os.path.exists(path):
118 raise ValueError(f"path does not exist: {path!r}")
119 lib.dc_msg_set_file_and_deduplicate(self._dc_msg, as_dc_charpointer(path), ffi.NULL, mtype)
120
121 @props.with_doc
122 def basename(self) -> str:

Callers 6

send_fileMethod · 0.80
send_imageMethod · 0.80
send_and_receive_messageFunction · 0.80
test_webxdc_messageFunction · 0.80
test_webxdc_huge_updateFunction · 0.80
test_quote_attachmentFunction · 0.80

Calls 2

as_dc_charpointerFunction · 0.85
existsMethod · 0.45

Tested by 4

send_and_receive_messageFunction · 0.64
test_webxdc_messageFunction · 0.64
test_webxdc_huge_updateFunction · 0.64
test_quote_attachmentFunction · 0.64