mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merged in masklinn/sphinx-1/masklinn/add-0000-to-potcreationdate-z-sets-an-e-1369740575399 (pull request #144)
Force timezone offset on POT-Creation-Date
This commit is contained in:
commit
e61d016ad1
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
from os import path, walk
|
from os import path, walk
|
||||||
from codecs import open
|
from codecs import open
|
||||||
from datetime import datetime
|
from datetime import datetime, tzinfo, timedelta
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
@ -107,6 +107,24 @@ class I18nBuilder(Builder):
|
|||||||
catalog.add(m, node)
|
catalog.add(m, node)
|
||||||
|
|
||||||
|
|
||||||
|
ZERO = timedelta(0)
|
||||||
|
HOUR = timedelta(hours=1)
|
||||||
|
|
||||||
|
class UTC(tzinfo):
|
||||||
|
"""UTC"""
|
||||||
|
|
||||||
|
def utcoffset(self, dt):
|
||||||
|
return ZERO
|
||||||
|
|
||||||
|
def tzname(self, dt):
|
||||||
|
return "UTC"
|
||||||
|
|
||||||
|
def dst(self, dt):
|
||||||
|
return ZERO
|
||||||
|
|
||||||
|
utc = UTC()
|
||||||
|
|
||||||
|
|
||||||
class MessageCatalogBuilder(I18nBuilder):
|
class MessageCatalogBuilder(I18nBuilder):
|
||||||
"""
|
"""
|
||||||
Builds gettext-style message catalogs (.pot files).
|
Builds gettext-style message catalogs (.pot files).
|
||||||
@ -155,7 +173,7 @@ class MessageCatalogBuilder(I18nBuilder):
|
|||||||
copyright = self.config.copyright,
|
copyright = self.config.copyright,
|
||||||
project = self.config.project,
|
project = self.config.project,
|
||||||
# XXX should supply tz
|
# XXX should supply tz
|
||||||
ctime = datetime.now().strftime('%Y-%m-%d %H:%M%z'),
|
ctime = datetime.now(utc).strftime('%Y-%m-%d %H:%M%z'),
|
||||||
)
|
)
|
||||||
for textdomain, catalog in self.status_iterator(
|
for textdomain, catalog in self.status_iterator(
|
||||||
self.catalogs.iteritems(), "writing message catalogs... ",
|
self.catalogs.iteritems(), "writing message catalogs... ",
|
||||||
|
Loading…
Reference in New Issue
Block a user