Author: johannes
Date: 2007-02-06 03:18:01 -0600 (Tue, 06 Feb 2007)
New Revision: 9350
Modified:
trunk/gnue-forms/src/input/displayHandlers/datehandler.py
Log:
added tip for time fields
Modified: trunk/gnue-forms/src/input/displayHandlers/datehandler.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/datehandler.py 2007-02-01
09:46:32 UTC (rev 9349)
+++ trunk/gnue-forms/src/input/displayHandlers/datehandler.py 2007-02-06
09:18:01 UTC (rev 9350)
@@ -468,8 +468,25 @@
raise InvalidTimeLiteral, display
+ # -------------------------------------------------------------------------
+ # Build a tip for the time field
+ # -------------------------------------------------------------------------
+ def get_tip(self):
+ """
+ Derive the apropriate tip from the sample time.
+ """
+ sample = datetime.time(13, 24, 56)
+ result = sample.strftime(str(self._input_mask))
+ result = result.replace('13', u_('H') * 2)
+ result = result.replace('01', u_('H') * 2)
+ result = result.replace('24', u_('M') * 2)
+ result = result.replace('56', u_('S') * 2)
+ return result
+
+
+
class DateTime(BaseCursor):
"""
Class to handle the display and entry of date based fields.
_______________________________________________
commit-gnue mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/commit-gnue