commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r8314 - trunk/gnue-common/scripts


From: reinhard
Subject: [gnue] r8314 - trunk/gnue-common/scripts
Date: Mon, 3 Apr 2006 18:23:45 -0500 (CDT)

Author: reinhard
Date: 2006-03-31 11:10:04 -0600 (Fri, 31 Mar 2006)
New Revision: 8314

Modified:
   trunk/gnue-common/scripts/gnuedtd
Log:
Fixed indenting of generated DTD.


Modified: trunk/gnue-common/scripts/gnuedtd
===================================================================
--- trunk/gnue-common/scripts/gnuedtd   2006-03-31 17:00:20 UTC (rev 8313)
+++ trunk/gnue-common/scripts/gnuedtd   2006-03-31 17:10:04 UTC (rev 8314)
@@ -248,7 +248,7 @@
         firstindent = indent
 
       pos = 0
-      rv = ""
+      rv = " " * firstindent
       width = 78 - firstindent
       for word in string.split(text): 
         if (len(word) + pos) > width: 
@@ -377,15 +377,14 @@
             deprecated = "\n[%s] " % deprecated
 
           self.dest.write(self.wrap(17,
-            '  <!-- DEPRECATED: The "%s" attribute of "%s" '
-            'has been deprecated %s -->' % (att, element, deprecated),0))
+            '<!-- DEPRECATED: The "%s" attribute of "%s" '
+            'has been deprecated %s -->' % (att, element, deprecated),2))
 
 
         descr = self.default(self.xmlElements[element]['Attributes'][att],
                          'Description','')
         if len(descr):
-          self.dest.write(o(self.wrap(7, '  <!-- %s: %s -->' % (att, descr),
-                                      0)))
+          self.dest.write(o(self.wrap(7, '<!-- %s: %s -->' % (att, descr), 2)))
 
         datatype = self.default(
              self.xmlElements[element]['Attributes'][att],
@@ -398,56 +397,56 @@
 
         # handle bool attributes specially
         if datatype == GTypecast.boolean:
-          self.dest.write(self.wrap(len(attdef),attdef +'%boolean;>',0))
+          self.dest.write(self.wrap(len(attdef) + 2, attdef +'%boolean;>', 2))
 
         elif set != None:
           set = set.keys()
           set.sort()
           if len(set) == 1:
-            indent = len(attdef)
+            indent = len(attdef) + 2
             attdef = attdef + '%s #FIXED "%s">' \
                 % (self.typecasts[datatype], set[0])
           else:
             attdef = attdef + "("
-            indent = len(attdef)
+            indent = len(attdef) + 2
             attdef = attdef + "%s)" % string.join(set, ' | ')
             if dflt != None and len(dflt):
               attdef = attdef + ' "%s">' % dflt
             else:
               attdef = attdef + ' #IMPLIED>'
-          self.dest.write(self.wrap(indent, attdef, 0))
+          self.dest.write(self.wrap(indent, attdef, 2))
 
         elif refs != None:
-          indent = len(attdef)
+          indent = len(attdef) + 2
           if req:
             attdef = attdef + ' IDREF #REQUIRED>'
           else:
             attdef = attdef + ' IDREF #IMPLIED>'
-          self.dest.write(self.wrap(indent, attdef, 0))
+          self.dest.write(self.wrap(indent, attdef, 2))
 
         elif unq:
-          indent = len(attdef)
+          indent = len(attdef) + 2
           if req:
             attdef = attdef + ' ID #REQUIRED>'
           else:
             attdef = attdef + ' ID #IMPLIED>'
-          self.dest.write(self.wrap(indent, attdef, 0))
+          self.dest.write(self.wrap(indent, attdef, 2))
 
         elif dflt != None:
-          indent = len(attdef)
+          indent = len(attdef) + 2
           attdef = attdef + ' %s "%s">' \
               % (self.typecasts[datatype], dflt)
-          self.dest.write(self.wrap(indent, attdef, 0))
+          self.dest.write(self.wrap(indent, attdef, 2))
 
         else:
-          indent = len(attdef)
+          indent = len(attdef) + 1
           if req: 
             attdef = attdef + ' %s #REQUIRED>' \
               % (self.typecasts[datatype]) 
           else: 
             attdef = attdef + ' %s #IMPLIED>' \
               % (self.typecasts[datatype]) 
-          self.dest.write(self.wrap(indent, attdef, 0))
+          self.dest.write(self.wrap(indent, attdef, 2))
           
     
     self.dest.write ("\n")





reply via email to

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