コード例 #1
0
ファイル: imap_client.py プロジェクト: jgrynczewski/pisak
 def _get_message(self, mailbox, id):
     self._call('select', mailbox)
     res, msg_data = self._call('fetch', id, '(RFC822)')
     if res != self._positive_response_code:
         ret = False
     else:
         ret =  parsers.parse_message(
             msg_data[0][1].decode(parsers.DEFAULT_CHARSET, "replace"))
     return ret
コード例 #2
0
ファイル: imap_client.py プロジェクト: Sasza/pisak
 def _get_message(self, mailbox, id):
     self._conn.select(mailbox)
     res, msg_data = self._conn.fetch(id, '(RFC822)')
     if res != self._positive_response_code:
         ret = False
     else:
         ret =  parsers.parse_message(
             msg_data[0][1].decode(parsers.DEFAULT_CHARSET, "replace"))
     return ret
コード例 #3
0
ファイル: imap_client.py プロジェクト: Sasza/pisak
 def _get_many_messages(self, mailbox, ids):
     ids = ' ,'.join(ids)
     self._conn.select(mailbox)
     res, msgs_data = self._conn.fetch(ids, '(RFC822)')
     if res != self._positive_response_code:
         ret = False
     else:
         ret = []
         for msg in msgs_data[0][1]:
             ret.append(parsers.parse_message(
                 msg.decode(parsers.DEFAULT_CHARSET, "replace")))
     return ret
コード例 #4
0
ファイル: imap_client.py プロジェクト: Sasza/pisak
 def _get_many_messages(self, mailbox, ids):
     ids = ' ,'.join(ids)
     self._conn.select(mailbox)
     res, msgs_data = self._conn.fetch(ids, '(RFC822)')
     if res != self._positive_response_code:
         ret = False
     else:
         ret = []
         for msg in msgs_data[0][1]:
             ret.append(
                 parsers.parse_message(
                     msg.decode(parsers.DEFAULT_CHARSET, "replace")))
     return ret