Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(6)  |  Derive(0)  |  Import(4)

        def parse_httpdate(date):
    date = parsedate(date)
    if date is None:
        return None
    if date[0] < 1970:
        date = (date[0] + 2000,) +date[1:]
    return calendar.timegm(date)
        


src/m/a/MapProxy-1.6.0/mapproxy/response.py   MapProxy(Download)
 
import hashlib
from mapproxy.util.times import format_httpdate, parse_httpdate, timestamp
 
class Response(object):
        elif self._timestamp is not None:
            date = environ.get('HTTP_IF_MODIFIED_SINCE', None)
            timestamp = parse_httpdate(date)
            if timestamp is not None and self._timestamp <= timestamp:
                not_modified = True

src/m/a/mapproxy-HEAD/mapproxy/response.py   mapproxy(Download)
 
import hashlib
from mapproxy.util.times import format_httpdate, parse_httpdate, timestamp
 
class Response(object):
        elif self._timestamp is not None:
            date = environ.get('HTTP_IF_MODIFIED_SINCE', None)
            timestamp = parse_httpdate(date)
            if timestamp is not None and self._timestamp <= timestamp:
                not_modified = True

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_timeutils.py   MapProxy(Download)
 
from datetime import datetime
from mapproxy.util.times import parse_httpdate, format_httpdate, timestamp
from nose.tools import eq_, raises
 
            'Fri Feb 13 23:31:30 2009',
            ):
            eq_(parse_httpdate(date), 1234567890)
 
    def test_parse_invalid(self):
            'Fri, 13 Foo 2009 23:31:30 GMT'
            ):
            eq_(parse_httpdate(date), None)
 
    def test_format_httpdate(self):

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_timeutils.py   mapproxy(Download)
 
from datetime import datetime
from mapproxy.util.times import parse_httpdate, format_httpdate, timestamp
from nose.tools import eq_, raises
 
            'Fri Feb 13 23:31:30 2009',
            ):
            eq_(parse_httpdate(date), 1234567890)
 
    def test_parse_invalid(self):
            'Fri, 13 Foo 2009 23:31:30 GMT'
            ):
            eq_(parse_httpdate(date), None)
 
    def test_format_httpdate(self):