Small patch/localtime
Vasil Kolev
vasil at ludost.net
Fri Sep 7 19:59:12 EST 2007
Hi,
I did a small change in my venus installation, to be able to display the
local time (not the UTC one) for the last update. Here's the patch:
(I'm sorry if inlining the patch is considered rude, it's just too minor
of a change for a whole bzr setup :) )
(with this you just need to use date_local in the template instead of
date)
diff -ur v1/venus/planet/shell/tmpl.py venus/planet/shell/tmpl.py
--- v1/venus/planet/shell/tmpl.py 2007-06-25 17:03:38.000000000 +0300
+++ venus/planet/shell/tmpl.py 2007-09-07 12:23:56.000000000 +0300
@@ -101,6 +101,7 @@
['date_822', Rfc822, 'updated_parsed'],
['date_iso', Rfc3399, 'published_parsed'],
['date_iso', Rfc3399, 'updated_parsed'],
+ ['date_local', PlanetDate, 'updated_parsed'],
['enclosure_href', String, 'links', {'rel': 'enclosure'}, 'href'],
['enclosure_length', String, 'links', {'rel': 'enclosure'}, 'length'],
['enclosure_type', String, 'links', {'rel': 'enclosure'}, 'type'],
@@ -223,6 +224,9 @@
output['date_iso'] = Rfc3399(date)
output['date_822'] = Rfc822(date)
+ date2 = time.localtime()
+ output['date_local'] = PlanetDate(date2)
+
# remove new_dates and new_channels that aren't "new"
date = channel = None
for item in output['Items']:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: =?UTF-8?Q?=D0=A2=D0=BE=D0=B2=D0=B0?= =?UTF-8?Q?_=D0=B5?=
=?UTF-8?Q?_=D1=86=D0=B8=D1=84=D1=80=D0=BE=D0=B2=D0=BE?=
=?UTF-8?Q?_=D0=BF=D0=BE=D0=B4=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B0?=
=?UTF-8?Q?_=D1=87=D0=B0=D1=81=D1=82?= =?UTF-8?Q?_=D0=BE=D1=82?=
=?UTF-8?Q?_=D0=BF=D0=B8=D1=81=D0=BC=D0=BE=D1=82=D0=BE?=
Url : /archives/devel/attachments/20070907/82901052/attachment.pgp
More information about the devel
mailing list