[Checkins] SVN: DateTime/trunk/src/DateTime/DateTime.py Turn strftimeFormatter into a function

Hanno Schlichting hannosch at hannosch.eu
Sun May 8 07:44:11 EDT 2011


Log message for revision 121582:
  Turn strftimeFormatter into a function
  

Changed:
  U   DateTime/trunk/src/DateTime/DateTime.py

-=-
Modified: DateTime/trunk/src/DateTime/DateTime.py
===================================================================
--- DateTime/trunk/src/DateTime/DateTime.py	2011-05-08 11:41:40 UTC (rev 121581)
+++ DateTime/trunk/src/DateTime/DateTime.py	2011-05-08 11:44:10 UTC (rev 121582)
@@ -310,21 +310,15 @@
     return "%+03d:%02d" % divmod((seconds / 60), 60)
 
 
-class strftimeFormatter:
-
-    def __init__(self, dt, format):
-        self._dt=dt
-        self._f=format
-
-    def __call__(self):
-        return self._dt.strftime(self._f)
-
-
 def Timezones():
     """Return the list of recognized timezone names"""
     return sorted(list(PytzCache._zmap.values()))
 
 
+def strftimeFormatter(dt, format):
+    return dt.strftime(format)
+
+
 class DateTime(object):
     """DateTime objects represent instants in time and provide
        interfaces for controlling its representation without



More information about the checkins mailing list