当前位置: 首页>>代码示例>>Python>>正文


Python rfc822.parsedate方法代码示例

本文整理汇总了Python中rfc822.parsedate方法的典型用法代码示例。如果您正苦于以下问题:Python rfc822.parsedate方法的具体用法?Python rfc822.parsedate怎么用?Python rfc822.parsedate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rfc822的用法示例。


在下文中一共展示了rfc822.parsedate方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_header

# 需要导入模块: import rfc822 [as 别名]
# 或者: from rfc822 import parsedate [as 别名]
def get_header(patch, line, input):
    if line == '':
        if patch.author == '':
            print 'Funky auth line in', patch.commit
            patch.author = database.LookupStoreHacker('Unknown',
                                                      'unknown@hacker.net')
        return S_DESC
    m = patterns['author'].match(line)
    if m:
        patch.email = database.RemapEmail(m.group(2))
        patch.author = database.LookupStoreHacker(m.group(1), patch.email)
    else:
        m = patterns['date'].match(line)
        if m:
            dt = rfc822.parsedate(m.group(2))
            patch.date = datetime.date(dt[0], dt[1], dt[2])
    return S_HEADER 
开发者ID:mendersoftware,项目名称:integration,代码行数:19,代码来源:gitlog.py

示例2: search_SENTBEFORE

# 需要导入模块: import rfc822 [as 别名]
# 或者: from rfc822 import parsedate [as 别名]
def search_SENTBEFORE(self, query, id, msg):
        """
        Returns C{True} if the message date is earlier than the query date.

        @type query: A C{list} of C{str}
        @param query: A list whose first element starts with a stringified date
            that is a fragment of an L{imap4.Query()}. The date must be in the
            format 'DD-Mon-YYYY', for example '03-March-2003' or '03-Mar-2003'.

        @type id: C{int}
        @param id: The sequence number of the message being checked.

        @type msg: Provider of L{imap4.IMessage}
        """
        date = msg.getHeaders(False, 'date').get('date', '')
        date = rfc822.parsedate(date)
        return date < parseTime(query.pop(0)) 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:19,代码来源:imap4.py

示例3: stat

# 需要导入模块: import rfc822 [as 别名]
# 或者: from rfc822 import parsedate [as 别名]
def stat(self, **kwargs):
        """Gets information about an object."""
        url_endpoint, params, headers, _ = self._get_parameters(**kwargs)
        resp = self.get_requests_session().head(
            url_endpoint, params=params, headers=headers)

        if resp.ok:
            return location.LocationStat.from_keywords(
                session=self._session,
                location=self,
                size=resp.headers["x-goog-stored-content-length"],
                generation=resp.headers["x-goog-generation"],
                created=arrow.Arrow(*(rfc822.parsedate(
                    resp.headers["Last-Modified"])[:7])).timestamp,
           ) 
开发者ID:google,项目名称:rekall,代码行数:17,代码来源:cloud.py

示例4: created_at_in_seconds

# 需要导入模块: import rfc822 [as 别名]
# 或者: from rfc822 import parsedate [as 别名]
def created_at_in_seconds(self):
        """ Get the time this status message was posted, in seconds since
        the epoch (1 Jan 1970).

        Returns:
            int: The time this status message was posted, in seconds since
            the epoch.
        """
        return timegm(parsedate(self.created_at)) 
开发者ID:doncat99,项目名称:StockRecommendSystem,代码行数:11,代码来源:models.py

示例5: search_BEFORE

# 需要导入模块: import rfc822 [as 别名]
# 或者: from rfc822 import parsedate [as 别名]
def search_BEFORE(self, query, id, msg):
        date = parseTime(query.pop(0))
        return rfc822.parsedate(msg.getInternalDate()) < date 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:5,代码来源:imap4.py

示例6: search_ON

# 需要导入模块: import rfc822 [as 别名]
# 或者: from rfc822 import parsedate [as 别名]
def search_ON(self, query, id, msg):
        date = parseTime(query.pop(0))
        return rfc822.parsedate(msg.getInternalDate()) == date 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:5,代码来源:imap4.py

示例7: search_SENTON

# 需要导入模块: import rfc822 [as 别名]
# 或者: from rfc822 import parsedate [as 别名]
def search_SENTON(self, query, id, msg):
        """
        Returns C{True} if the message date is the same as the query date.

        @type query: A C{list} of C{str}
        @param query: A list whose first element starts with a stringified date
            that is a fragment of an L{imap4.Query()}. The date must be in the
            format 'DD-Mon-YYYY', for example '03-March-2003' or '03-Mar-2003'.

        @type msg: Provider of L{imap4.IMessage}
        """
        date = msg.getHeaders(False, 'date').get('date', '')
        date = rfc822.parsedate(date)
        return date[:3] == parseTime(query.pop(0))[:3] 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:16,代码来源:imap4.py

示例8: search_SENTSINCE

# 需要导入模块: import rfc822 [as 别名]
# 或者: from rfc822 import parsedate [as 别名]
def search_SENTSINCE(self, query, id, msg):
        """
        Returns C{True} if the message date is later than the query date.

        @type query: A C{list} of C{str}
        @param query: A list whose first element starts with a stringified date
            that is a fragment of an L{imap4.Query()}. The date must be in the
            format 'DD-Mon-YYYY', for example '03-March-2003' or '03-Mar-2003'.

        @type msg: Provider of L{imap4.IMessage}
        """
        date = msg.getHeaders(False, 'date').get('date', '')
        date = rfc822.parsedate(date)
        return date > parseTime(query.pop(0)) 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:16,代码来源:imap4.py

示例9: GetCreatedAtInSeconds

# 需要导入模块: import rfc822 [as 别名]
# 或者: from rfc822 import parsedate [as 别名]
def GetCreatedAtInSeconds(self):
    '''Get the time this status message was posted, in seconds since the epoch.

    Returns:
      The time this status message was posted, in seconds since the epoch.
    '''
    return calendar.timegm(rfc822.parsedate(self.created_at)) 
开发者ID:kuri65536,项目名称:python-for-android,代码行数:9,代码来源:twitter.py

示例10: search_SENTBEFORE

# 需要导入模块: import rfc822 [as 别名]
# 或者: from rfc822 import parsedate [as 别名]
def search_SENTBEFORE(self, query, id, msg):
        date = msg.getHeader(False, 'date').get('date', '')
        date = rfc822.parsedate(date)
        return date < parseTime(query.pop(0)) 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:6,代码来源:imap4.py

示例11: search_SENTON

# 需要导入模块: import rfc822 [as 别名]
# 或者: from rfc822 import parsedate [as 别名]
def search_SENTON(self, query, id, msg):
        date = msg.getHeader(False, 'date').get('date', '')
        date = rfc822.parsedate(date)
        return date[:3] == parseTime(query.pop(0))[:3] 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:6,代码来源:imap4.py

示例12: search_SENTSINCE

# 需要导入模块: import rfc822 [as 别名]
# 或者: from rfc822 import parsedate [as 别名]
def search_SENTSINCE(self, query, id, msg):
        date = msg.getHeader(False, 'date').get('date', '')
        date = rfc822.parsedate(date)
        return date > parseTime(query.pop(0)) 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:6,代码来源:imap4.py


注:本文中的rfc822.parsedate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。