Skip to content

Allow to override sitemap time #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
language: python

python:
- 2.6
- 2.7

install:
- pip install -r requirements_dev.txt --use-mirrors
- pip install -r requirements_dev.txt
- python setup.py install

script: python setup.py test
3 changes: 3 additions & 0 deletions doc/sitemap_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2020,6 +2020,9 @@ def OpenFileForRead(path, logtext):

def TimestampISO8601(t):
"""Seconds since epoch (1970-01-01) --> ISO 8601 time string."""
sde = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
if t > sde:
t = sde
return time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(t))
#end def TimestampISO8601

Expand Down
4 changes: 2 additions & 2 deletions tests/004-test-client.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_006(u, c):
t.eq(r.body_string(), "ok")


@t.client_request('http://e-engura.com/images/logo.gif')
@t.client_request('http://www.lsmod.de/~bernhard/mirror/e-engura.com/images/logo.gif')
def test_007(u, c):
r = c.request(u)
print r.status
Expand All @@ -124,7 +124,7 @@ def test_007(u, c):
t.eq(imghdr.what(fname), 'gif')


@t.client_request('http://e-engura.com/images/logo.gif')
@t.client_request('http://www.lsmod.de/~bernhard/mirror/e-engura.com/images/logo.gif')
def test_008(u, c):
r = c.request(u)
t.eq(r.status_int, 200)
Expand Down