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

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

        def format_httpdate(date):
    date = timestamp(date)
    return format_date_time(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):
    def _last_modified_set(self, date):
        if not date: return
        self._timestamp = timestamp(date)
        self.headers['Last-modified'] = format_httpdate(self._timestamp)
    def _last_modified_get(self):

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):
    def _last_modified_set(self, date):
        if not date: return
        self._timestamp = timestamp(date)
        self.headers['Last-modified'] = format_httpdate(self._timestamp)
    def _last_modified_get(self):

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
 
    def test_format_httpdate(self):
        eq_(format_httpdate(datetime.fromtimestamp(1234567890)),
            'Fri, 13 Feb 2009 23:31:30 GMT')
        eq_(format_httpdate(1234567890),
            'Fri, 13 Feb 2009 23:31:30 GMT')
 
    @raises(AssertionError)
    def test_format_invalid(self):
        format_httpdate('foobar')

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
 
    def test_format_httpdate(self):
        eq_(format_httpdate(datetime.fromtimestamp(1234567890)),
            'Fri, 13 Feb 2009 23:31:30 GMT')
        eq_(format_httpdate(1234567890),
            'Fri, 13 Feb 2009 23:31:30 GMT')
 
    @raises(AssertionError)
    def test_format_invalid(self):
        format_httpdate('foobar')

src/m/a/mapproxy-HEAD/mapproxy/test/system/test_kml.py   mapproxy(Download)
from cStringIO import StringIO
from mapproxy.srs import bbox_equals
from mapproxy.util.times import format_httpdate
from mapproxy.test.image import is_jpeg, tmp_image
from mapproxy.test.http import mock_httpd
            assert 'Last-modified' not in resp.headers
        else:
            eq_(resp.headers['Last-modified'], format_httpdate(timestamp))
        eq_(resp.headers['Cache-control'], 'max-age=%d public' % max_age)
 

src/m/a/MapProxy-1.6.0/mapproxy/test/system/test_kml.py   MapProxy(Download)
from cStringIO import StringIO
from mapproxy.srs import bbox_equals
from mapproxy.util.times import format_httpdate
from mapproxy.test.image import is_jpeg, tmp_image
from mapproxy.test.http import mock_httpd
            assert 'Last-modified' not in resp.headers
        else:
            eq_(resp.headers['Last-modified'], format_httpdate(timestamp))
        eq_(resp.headers['Cache-control'], 'max-age=%d public' % max_age)