當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。