def _process_message(self, mes): if CommonMethods.get_tomes_tool(): e_msg = DmMessage(self.expand_path_from_map(self.current_relpath), CommonMethods.increment_local_id(), mes, self.cur_fn) else: e_msg = DmMessage(self.current_relpath, CommonMethods.increment_local_id(), mes, self.cur_fn) e_msg.message = None self.messages.append(e_msg)
def _simple_ext_body(self): extbody = ExtBodyContent() extbody.local_id = CommonMethods.increment_local_id() extbody.transfer_encoding = self.transfer_encoding extbody.hash = CommonMethods.get_hash(bytes(self.body_content, encoding='utf-8')) children = OrderedDict({ "ContentType": self.content_type, "Disposition": self.disposition, "DispositionFileName": self.disposition_file_name, "ContentTransferEncoding": self.transfer_encoding }) extbody.build_xml_file(children) self.ext_body_content.append(extbody) self.payload = None self.body_content = None
def _full_ext_body(self): extbody = ExtBodyContent() extbody.char_set = self.charset extbody.local_id = CommonMethods.increment_local_id() extbody.gid = "{0:0>5}_{1}".format(extbody.local_id, extbody.gid) extbody.transfer_encoding = self.transfer_encoding extbody.eol = CommonMethods.get_eol(self.payload.get_payload()) extbody.hash = CommonMethods.get_hash(self.payload.as_bytes()) extbody.body_content = self.payload.get_payload() children = OrderedDict({ "ContentType": self.content_type, "Disposition": self.disposition, "DispositionFileName": self.disposition_file_name, "ContentTransferEncoding": self.transfer_encoding }) extbody.build_xml_file(children) self.ext_body_content.append(extbody) self.payload = None
def _process_message(self, mes, path): e_msg = DmMessage(self.get_rel_path(path), CommonMethods.increment_local_id(), mes) e_msg.message = None self.messages.append(e_msg)