MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / prepare

Method prepare

keepercommander/attachment.py:160–168  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

158 self.is_script = is_script
159
160 def prepare(self):
161 self.file_path = os.path.expanduser(self.file_path)
162 if not os.path.isfile(self.file_path):
163 raise ValueError(f'File {self.file_path} does not exist')
164 self.size = os.path.getsize(self.file_path)
165 if not self.mime_type:
166 mt = mimetypes.guess_type(self.file_path)
167 if isinstance(mt, tuple) and mt[0]:
168 self.mime_type = mt[0]
169
170 @contextlib.contextmanager
171 def open(self):

Callers 1

set_logoMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected