79 def __str__(self, prefix="", printElemNumber=0): |
79 def __str__(self, prefix="", printElemNumber=0): |
80 res="" |
80 res="" |
81 return res |
81 return res |
82 |
82 |
83 |
83 |
84 _TEXT = ( |
84 def _BuildTagLookupTable(sparse, maxtag, default=None): |
85 "ErrorCode", |
85 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
86 ) |
86 |
87 |
87 |
88 _TYPES = ( |
88 _TEXT = _BuildTagLookupTable({ |
89 ProtocolBuffer.Encoder.NUMERIC, |
89 0: "ErrorCode", |
90 ) |
90 }, 0) |
|
91 |
|
92 _TYPES = _BuildTagLookupTable({ |
|
93 0: ProtocolBuffer.Encoder.NUMERIC, |
|
94 }, 0, ProtocolBuffer.Encoder.MAX_TYPE) |
91 |
95 |
92 _STYLE = """""" |
96 _STYLE = """""" |
93 _STYLE_CONTENT_TYPE = """""" |
97 _STYLE_CONTENT_TYPE = """""" |
94 class MailAttachment(ProtocolBuffer.ProtocolMessage): |
98 class MailAttachment(ProtocolBuffer.ProtocolMessage): |
95 has_filename_ = 0 |
99 has_filename_ = 0 |
185 res="" |
189 res="" |
186 if self.has_filename_: res+=prefix+("FileName: %s\n" % self.DebugFormatString(self.filename_)) |
190 if self.has_filename_: res+=prefix+("FileName: %s\n" % self.DebugFormatString(self.filename_)) |
187 if self.has_data_: res+=prefix+("Data: %s\n" % self.DebugFormatString(self.data_)) |
191 if self.has_data_: res+=prefix+("Data: %s\n" % self.DebugFormatString(self.data_)) |
188 return res |
192 return res |
189 |
193 |
|
194 |
|
195 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
196 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
197 |
190 kFileName = 1 |
198 kFileName = 1 |
191 kData = 2 |
199 kData = 2 |
192 |
200 |
193 _TEXT = ( |
201 _TEXT = _BuildTagLookupTable({ |
194 "ErrorCode", |
202 0: "ErrorCode", |
195 "FileName", |
203 1: "FileName", |
196 "Data", |
204 2: "Data", |
197 ) |
205 }, 2) |
198 |
206 |
199 _TYPES = ( |
207 _TYPES = _BuildTagLookupTable({ |
200 ProtocolBuffer.Encoder.NUMERIC, |
208 0: ProtocolBuffer.Encoder.NUMERIC, |
201 ProtocolBuffer.Encoder.STRING, |
209 1: ProtocolBuffer.Encoder.STRING, |
202 |
210 2: ProtocolBuffer.Encoder.STRING, |
203 ProtocolBuffer.Encoder.STRING, |
211 }, 2, ProtocolBuffer.Encoder.MAX_TYPE) |
204 |
|
205 ) |
|
206 |
212 |
207 _STYLE = """""" |
213 _STYLE = """""" |
208 _STYLE_CONTENT_TYPE = """""" |
214 _STYLE_CONTENT_TYPE = """""" |
209 class MailMessage(ProtocolBuffer.ProtocolMessage): |
215 class MailMessage(ProtocolBuffer.ProtocolMessage): |
210 has_sender_ = 0 |
216 has_sender_ = 0 |
530 res+=e.__str__(prefix + " ", printElemNumber) |
536 res+=e.__str__(prefix + " ", printElemNumber) |
531 res+=prefix+">\n" |
537 res+=prefix+">\n" |
532 cnt+=1 |
538 cnt+=1 |
533 return res |
539 return res |
534 |
540 |
|
541 |
|
542 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
543 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
544 |
535 kSender = 1 |
545 kSender = 1 |
536 kReplyTo = 2 |
546 kReplyTo = 2 |
537 kTo = 3 |
547 kTo = 3 |
538 kCc = 4 |
548 kCc = 4 |
539 kBcc = 5 |
549 kBcc = 5 |
540 kSubject = 6 |
550 kSubject = 6 |
541 kTextBody = 7 |
551 kTextBody = 7 |
542 kHtmlBody = 8 |
552 kHtmlBody = 8 |
543 kAttachment = 9 |
553 kAttachment = 9 |
544 |
554 |
545 _TEXT = ( |
555 _TEXT = _BuildTagLookupTable({ |
546 "ErrorCode", |
556 0: "ErrorCode", |
547 "Sender", |
557 1: "Sender", |
548 "ReplyTo", |
558 2: "ReplyTo", |
549 "To", |
559 3: "To", |
550 "Cc", |
560 4: "Cc", |
551 "Bcc", |
561 5: "Bcc", |
552 "Subject", |
562 6: "Subject", |
553 "TextBody", |
563 7: "TextBody", |
554 "HtmlBody", |
564 8: "HtmlBody", |
555 "Attachment", |
565 9: "Attachment", |
556 ) |
566 }, 9) |
557 |
567 |
558 _TYPES = ( |
568 _TYPES = _BuildTagLookupTable({ |
559 ProtocolBuffer.Encoder.NUMERIC, |
569 0: ProtocolBuffer.Encoder.NUMERIC, |
560 ProtocolBuffer.Encoder.STRING, |
570 1: ProtocolBuffer.Encoder.STRING, |
561 |
571 2: ProtocolBuffer.Encoder.STRING, |
562 ProtocolBuffer.Encoder.STRING, |
572 3: ProtocolBuffer.Encoder.STRING, |
563 |
573 4: ProtocolBuffer.Encoder.STRING, |
564 ProtocolBuffer.Encoder.STRING, |
574 5: ProtocolBuffer.Encoder.STRING, |
565 |
575 6: ProtocolBuffer.Encoder.STRING, |
566 ProtocolBuffer.Encoder.STRING, |
576 7: ProtocolBuffer.Encoder.STRING, |
567 |
577 8: ProtocolBuffer.Encoder.STRING, |
568 ProtocolBuffer.Encoder.STRING, |
578 9: ProtocolBuffer.Encoder.STRING, |
569 |
579 }, 9, ProtocolBuffer.Encoder.MAX_TYPE) |
570 ProtocolBuffer.Encoder.STRING, |
|
571 |
|
572 ProtocolBuffer.Encoder.STRING, |
|
573 |
|
574 ProtocolBuffer.Encoder.STRING, |
|
575 |
|
576 ProtocolBuffer.Encoder.STRING, |
|
577 |
|
578 ) |
|
579 |
580 |
580 _STYLE = """""" |
581 _STYLE = """""" |
581 _STYLE_CONTENT_TYPE = """""" |
582 _STYLE_CONTENT_TYPE = """""" |
582 |
583 |
583 __all__ = ['MailServiceError','MailAttachment','MailMessage'] |
584 __all__ = ['MailServiceError','MailAttachment','MailMessage'] |