當前位置: 首頁>>代碼示例>>Python>>正文


Python imaplib.Time2Internaldate方法代碼示例

本文整理匯總了Python中imaplib.Time2Internaldate方法的典型用法代碼示例。如果您正苦於以下問題:Python imaplib.Time2Internaldate方法的具體用法?Python imaplib.Time2Internaldate怎麽用?Python imaplib.Time2Internaldate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在imaplib的用法示例。


在下文中一共展示了imaplib.Time2Internaldate方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _multiappend

# 需要導入模塊: import imaplib [as 別名]
# 或者: from imaplib import Time2Internaldate [as 別名]
def _multiappend(con, box, msgs):
    with _cmd(con, 'APPEND') as (tag, start, complete):
        send = start
        for date_time, flags, msg in msgs:
            flags = clean_recent(flags)
            if date_time is None:
                date_time = Time2Internaldate(time.time())
            args = (' (%s) %s %s' % (flags, date_time, '{%s}' % len(msg)))
            if send == start:
                args = ' %s %s' % (box, args)
            send(args.encode() + CRLF)
            send = con.send
            while con._get_response():
                bad = con.tagged_commands[tag]
                if bad:
                    raise Error(bad)
            con.send(msg)
        con.send(CRLF)
        res = check(complete())
        log.debug('%s', res[0].decode())
        uids = con.untagged_responses.pop('APPENDUID')
        uids = uids[0].decode().split(' ', 1)[-1]
        return uids 
開發者ID:naspeh,項目名稱:mailur,代碼行數:25,代碼來源:imap.py

示例2: test_that_Time2Internaldate_returns_a_result

# 需要導入模塊: import imaplib [as 別名]
# 或者: from imaplib import Time2Internaldate [as 別名]
def test_that_Time2Internaldate_returns_a_result(self):
        # We can check only that it successfully produces a result,
        # not the correctness of the result itself, since the result
        # depends on the timezone the machine is in.
        timevalues = [2000000000, 2000000000.0, time.localtime(2000000000),
                      '"18-May-2033 05:33:20 +0200"']

        for t in timevalues:
            imaplib.Time2Internaldate(t) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:11,代碼來源:test_imaplib.py

示例3: test_Time2Internaldate

# 需要導入模塊: import imaplib [as 別名]
# 或者: from imaplib import Time2Internaldate [as 別名]
def test_Time2Internaldate(self):
        expected = '"18-May-2033 05:33:20 +0200"'

        for t in self.timevalues():
            internal = imaplib.Time2Internaldate(t)
            self.assertEqual(internal, expected) 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:8,代碼來源:test_imaplib.py

示例4: test_that_Time2Internaldate_returns_a_result

# 需要導入模塊: import imaplib [as 別名]
# 或者: from imaplib import Time2Internaldate [as 別名]
def test_that_Time2Internaldate_returns_a_result(self):
        # Without tzset, we can check only that it successfully
        # produces a result, not the correctness of the result itself,
        # since the result depends on the timezone the machine is in.
        for t in self.timevalues():
            imaplib.Time2Internaldate(t) 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:8,代碼來源:test_imaplib.py

示例5: push_mail

# 需要導入模塊: import imaplib [as 別名]
# 或者: from imaplib import Time2Internaldate [as 別名]
def push_mail(self, folder, msg):
        now = imaplib.Time2Internaldate(time.time())
        msg = bytes(msg) if six.PY3 else str(msg)
        return self.m.append(
            self._encode_mbox_name(folder), r'(\Seen)', now, msg) 
開發者ID:modoboa,項目名稱:modoboa-webmail,代碼行數:7,代碼來源:imaputils.py


注:本文中的imaplib.Time2Internaldate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。