# HG changeset patch
# User Mihai Ibanescu <https://issues.rpath.com/>
# Date 1251397617 14400
# Node ID 2f9d6cf1a8b6fa48e7e3dfec10e3ceaa04356238
# Parent  c81eeab45d5f5d5351c716f06edfcde4239d8a4a
Added --no-dates

diff -r c81eeab45d5f -r 2f9d6cf1a8b6 generateDS.py
--- a/generateDS.py	Wed Aug 26 16:55:59 2009 -0400
+++ b/generateDS.py	Thu Aug 27 14:26:57 2009 -0400
@@ -31,6 +31,10 @@
     --user-methods= <module>,
     -u <module>              Optional module containing user methods.  See
                              section "User Methods" in the documentation.
+    --no-dates               Do not include the current date in the header
+                             file. This is useful if you want to minimize
+                             the amount of (no-operation) changes to the
+                             generated python code.
     --no-process-includes    Do not process included XML Schema files.  By
                              default, generateDS.py will insert content
                              from files referenced by <include ... />
@@ -3466,7 +3470,9 @@
 # DUMMY = '''
 
 def generateHeader(outfile, prefix):
-    s1 = TEMPLATE_HEADER % (time.ctime(), VERSION, ExternalEncoding, )
+    global NoDates
+    tstamp = (not NoDates and time.ctime()) or ''
+    s1 = TEMPLATE_HEADER % (tstamp, VERSION, ExternalEncoding, )
     outfile.write(s1)
 
 
@@ -3967,7 +3973,8 @@
                 behaviors.make_class_dictionary(cleanupName)
                 baseUrl = behaviors.getBase_impl_url()
         wrt = subclassFile.write
-        wrt(TEMPLATE_SUBCLASS_HEADER % (time.ctime(), VERSION,
+        tstamp = (not NoDates and time.ctime()) or ''
+        wrt(TEMPLATE_SUBCLASS_HEADER % (tstamp, VERSION,
             superModule, ExternalEncoding, ))
         for element in ElementsForSubclasses:
             generateSubclass(subclassFile, element, prefix, xmlbehavior, behaviors, baseUrl)
@@ -4291,7 +4298,7 @@
     global Force, GenerateProperties, SubclassSuffix, RootElement, \
         ValidatorBodiesBasePath, UseOldGetterSetter, \
         UserMethodsPath, XsdNameSpace, \
-        Namespacedef, \
+        Namespacedef, NoDates, \
         TEMPLATE_MAIN, TEMPLATE_SUBCLASS_FOOTER, Dirpath, \
         ExternalEncoding, MemberSpecs
     outputText = True
@@ -4302,7 +4309,7 @@
             'validator-bodies=', 'use-old-getter-setter',
             'user-methods=', 'no-process-includes', 'silence',
             'namespacedef=', 'external-encoding=',
-            'member-specs=',
+            'member-specs=', 'no-dates',
             'version',
             ])
     except getopt.GetoptError, exp:
@@ -4316,6 +4323,7 @@
     processIncludes = 1
     namespacedef = ''
     ExternalEncoding = sys.getdefaultencoding()
+    NoDates = False
     showVersion = False
     for option in options:
         if option[0] == '-h' or option[0] == '--help':
@@ -4334,6 +4342,8 @@
             behaviorFilename = option[1]
         elif option[0] == '-m':
             GenerateProperties = 1
+        elif option[0] == '--no-dates':
+            NoDates = True
         elif option[0] == '--search-path':
             Dirpath = option[1].split(':')
         elif option[0] == '--subclass-suffix':
