[Mpuls-commits] r2243 - in wasko/branches/2.0: . mpulsweb/lib
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Mar 29 17:55:14 CEST 2010
Author: bh
Date: 2010-03-29 17:55:13 +0200 (Mon, 29 Mar 2010)
New Revision: 2243
Modified:
wasko/branches/2.0/ChangeLog
wasko/branches/2.0/mpulsweb/lib/helpers.py
Log:
* mpulsweb/lib/helpers.py: Fix formatting.
Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog 2010-03-29 15:49:06 UTC (rev 2242)
+++ wasko/branches/2.0/ChangeLog 2010-03-29 15:55:13 UTC (rev 2243)
@@ -1,5 +1,9 @@
2010-03-29 Bernhard Herzog <bh at intevation.de>
+ * mpulsweb/lib/helpers.py: Fix formatting.
+
+2010-03-29 Bernhard Herzog <bh at intevation.de>
+
* mpulsweb/lib/navigation.py: Fix formatting.
2010-03-29 Bernhard Herzog <bh at intevation.de>
Modified: wasko/branches/2.0/mpulsweb/lib/helpers.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/helpers.py 2010-03-29 15:49:06 UTC (rev 2242)
+++ wasko/branches/2.0/mpulsweb/lib/helpers.py 2010-03-29 15:55:13 UTC (rev 2243)
@@ -79,12 +79,12 @@
"""
timeout = int(config.get("beaker.session.timeout"))
return format_time(datetime.datetime.now()
- + datetime.timedelta(seconds=timeout - 120))
+ + datetime.timedelta(seconds=timeout - 120))
def getHelp(help_id):
'''
Returns a HTML link with a help icon if help is present for help_id. Else
- return empty string
+ return empty string
'''
out = []
help = g.helpData.getHelp(help_id)
@@ -133,10 +133,10 @@
except KeyError:
return ''
-# Format functions
+# Format functions
def format_number(number):
- retval = locale.format("%.2f",(number),1)
+ retval = locale.format("%.2f", (number), 1)
return retval
def format_date(dt):
@@ -178,7 +178,8 @@
def timedelta_in_weeks(ti, empty=None):
if ti is None:
return empty
- return format_number(float(ti.days) / 7.0 + ti.seconds / (60.0 * 24.0 * 7.0))
+ return format_number(float(ti.days) / 7.0
+ + ti.seconds / (60.0 * 24.0 * 7.0))
def human_timedelta(td, empty=None):
if td is None:
@@ -193,10 +194,10 @@
if days > 1:
out.append("%d Tage," % days)
- secs = td.seconds
+ secs = td.seconds
hours = secs / 3600
secs -= hours * 3600
- mins = secs / 60
+ mins = secs / 60
secs -= mins * 60
out.append("%d:%02d:%02d" % (hours, mins, secs))
@@ -207,7 +208,7 @@
# Fallback functions for the localized format_* functions. If localalisation
# fails because of dates before 1900 (which aren't sensefull anyway') the
# fallback functions are called. These functions will convert dates and time in
-# german date and time formats
+# german date and time formats
def dd_mm_YYYY(d, empty=''):
"""Format the date of the date/time object d as 'dd.mm.YYYY'.
@@ -240,7 +241,7 @@
d = datetime.datetime(d.year, d.month, d.day)
return "%02d:%02d" % (d.hour, d.minute)
-def dd_mm_yyyy_HH_MM(d, empty = ''):
+def dd_mm_yyyy_HH_MM(d, empty=''):
"""Format the time/date object d as 'dd.mm.YYYY HH:MM'.
The parameter d may be a time, datetime or date instance. If it is
a date instance, time 00:00 is assumed. If d is None, the function
More information about the Mpuls-commits
mailing list