commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r5202 - trunk/gnue-common/src/schema/scripter/processors


From: johannes
Subject: r5202 - trunk/gnue-common/src/schema/scripter/processors
Date: Mon, 1 Mar 2004 06:49:43 -0600 (CST)

Author: johannes
Date: 2004-03-01 06:49:39 -0600 (Mon, 01 Mar 2004)
New Revision: 5202

Modified:
   trunk/gnue-common/src/schema/scripter/processors/Base.py
Log:
Use mx.DateTime.now () for the timestamp instead of strftime (), since the
latter one isn't unicode-safe :)


Modified: trunk/gnue-common/src/schema/scripter/processors/Base.py
===================================================================
--- trunk/gnue-common/src/schema/scripter/processors/Base.py    2004-03-01 
10:32:06 UTC (rev 5201)
+++ trunk/gnue-common/src/schema/scripter/processors/Base.py    2004-03-01 
12:49:39 UTC (rev 5202)
@@ -22,7 +22,7 @@
 
 from string import join
 from types import ListType, StringType
-from time import strftime
+from mx.DateTime import now
 
 # =============================================================================
 # Exceptions
@@ -133,11 +133,15 @@
     This method writes the 'text' (string/list) to the destination using 
     encoding. If text is a sequence it will be joined with newlines first.
     """
+
     if isinstance (text, ListType):
       astr = join (text, "\n") + u"\n"
     else:
       astr = text
 
+    if isinstance (astr, StringType):
+      print "astr is stringtype"
+
     self.destination.write (astr.encode (self.encoding))
 
   
@@ -411,8 +415,9 @@
     This method is called by the scripter on start of a dump. Use it to do 
     'per-generation' actions, e.g. set encoding 
     """
+    today = "%s UTC" % now ()
     text = _("This file was generated by gnue-schema\nfrom %s on %s.") % \
-            (self.source, strftime ("%c"))
+            (self.source, today)
 
     self._writeText (u"\n")
     self._writeText (self.comment (text.splitlines () + \





reply via email to

[Prev in Thread] Current Thread [Next in Thread]