当前位置: 首页>>代码示例>>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;未经允许,请勿转载。