Commit dc7f9c8dd0bd310374c296a67b2b2b84dc059689

Werner Lemberg 2000-08-27T07:12:40

Formatting. docmaker.py will now run with older Python versions also. Small fix.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
diff --git a/docs/docmaker.py b/docs/docmaker.py
index 5f35dbd..812b599 100644
--- a/docs/docmaker.py
+++ b/docs/docmaker.py
@@ -126,140 +126,139 @@ def make_block_list():
     #  5 - process source
     #
     
-    comment = []
-    source  = []
-    state   = 0
+    comment     = []
+    source      = []
+    state       = 0
 
     for line in fileinput.input():
 
-        # remove trailing CR
-        l = len(line)
-        if l > 0 and line[l-1] == '\012':
-            line = line[0:l-1]
+        l = len( line )
+        if l > 0 and line[l - 1] == '\012':
+            line = line[0 : l - 1]
 
         # stripped version of the line
-        line2 = string.strip(line)
-        l     = len(line2)
+        line2 = string.strip( line )
+        l     = len( line2 )
 
-        # if this line begins with a comment and we're processing some source, exit
-        # to state 0
+        # if this line begins with a comment and we are processing some
+        # source, exit to state 0
         #
-        if format >= 4 and l > 2 and line2[0:2] == '/*':
-            list.append( (block,source) )
+        if format >= 4 and l > 2 and line2[0 : 2] == '/*':
+            list.append( ( block, source ) )
             format = 0
-        
-        if format == 0:  ##################### wait beginning of comment ###########
-	    if l > 3 and line2[0:3] == '/**':
-		i = 3
-		while (i < l) and (line2[i] == '*'):
-		    i = i+1
-
-		if i == l:
-		    # this is '/**' followed by any number of '*', the
-		    # beginning of a Format 1 block
-		    #
-		    block  = []
-		    source = []
-		    format = 1
-
-		elif (i == l-1) and (line2[i] == '/'):
-		    # this is '/**' followed by any number of '*', followed
-		    # by a '/', i.e. the beginning of a Format 2 or 3 block
-		    #
-		    block  = []
-		    source = []
-		    format = 2
-
-	##############################################################
-	#
-	# FORMAT 1
-	#
-	elif format == 1:
-
-	    # if the line doesn't begin with a "*", something went
-	    # wrong, and we must exit, and forget the current block..
-	    if (l == 0) or (line2[0] != '*'):
-		block  = []
-		format = 0
-		
-	    # otherwise, we test for an end of block, which is an
-	    # arbitrary number of '*', followed by '/'
-	    else:
-		i = 1
-		while (i < l) and (line2[i] == '*'):
-		    i = i+1
-
-		# test for the end of the block
-		if (i < l) and (line2[i] == '/'):
-		    if block != []:
-		        format = 4
-		    else:
-		        format = 0
-		else:
-		    # otherwise simply append line to current block
-                    block.append(line2)
+
+        if format == 0:  #### wait for beginning of comment ####
+
+            if l > 3 and line2[0 : 3] == '/**':
+                i = 3
+                while i < l and line2[i] == '*':
+                    i = i + 1
+
+                if i == l:
+                    # this is '/**' followed by any number of '*', the
+                    # beginning of a Format 1 block
+                    #
+                    block  = []
+                    source = []
+                    format = 1
+
+                elif i == l - 1 and line2[i] == '/':
+                    # this is '/**' followed by any number of '*', followed
+                    # by a '/', i.e. the beginning of a Format 2 or 3 block
+                    #
+                    block  = []
+                    source = []
+                    format = 2
+
+        ##############################################################
+        #
+        # FORMAT 1
+        #
+        elif format == 1:
+
+            # if the line doesn't begin with a "*", something went
+            # wrong, and we must exit, and forget the current block..
+            if l == 0 or line2[0] != '*':
+                block  = []
+                format = 0
+                
+            # otherwise, we test for an end of block, which is an
+            # arbitrary number of '*', followed by '/'
+            else:
+                i = 1
+                while i < l and line2[i] == '*':
+                    i = i + 1
+
+                # test for the end of the block
+                if i < l and line2[i] == '/':
+                    if block != []:
+                        format = 4
+                    else:
+                        format = 0
+                else:
+                    # otherwise simply append line to current block
+                    block.append( line2 )
+
+                continue
+
+        ##############################################################
+        #
+        # FORMAT 2
+        #
+        elif format == 2:
+
+            # if the line doesn't begin with '/*' and end with '*/',
+            # this is the end of the format 2 format
+            if l < 4 or line2[: 2] != '/*' or line2[-2 :] != '*/':
+                if block != []:
+                    format = 4
+                else:
+                    format = 0
+            else:
+                # remove the start and end comment delimiters, then
+                # right-strip the line
+                line2 = string.rstrip( line2[2 : -2] )
+
+                # check for end of a format2 block, i.e. a run of '*'
+                if string.count( line2, '*' ) == l - 4:
+                    if block != []:
+                        format = 4
+                    else:
+                        format = 0
+                else:
+                    # otherwise, add the line to the current block
+                    block.append( line2 )
+                    
                 continue
 
-	##############################################################
-	#
-	# FORMAT 2
-	#
-	elif format == 2:
-
-	    # if the line doesn't begin with '/*' and end with '*/',
-	    # this is the end of the format 2 format..
-	    if (l < 4 ) or (line2[:2] != '/*') or (line2[-2:] != '*/'):
-		if block != []:
-			format = 4
-		else:
-			format = 0
-	    else:
-	        # remove the start and end comment delimiters, then right-strip
-	        # the line
-	        line2 = string.rstrip(line2[2:-2])
-
-	        # check for end of a format2 block, i.e. a run of '*'
-	        if string.count(line2,'*') == l-4:
-		    if block != []:
-			    format = 4
-		    else:
-			    format = 0
-	        else:
-		    # otherwise, add the line to the current block
-		    block.append(line2)
-		    
-	        continue
-
-
-
-        if format >= 4:  ########################## source processing ################
+
+
+        if format >= 4:  #### source processing ####
 
             if l > 0:
                 format = 5
                 
             if format == 5:
-                source.append(line)
+                source.append( line )
 
 
     if format >= 4:
-        list.append([block,source])
+        list.append( [block, source] )
         
     return list
 
 
-
-
     
 # This function is only used for debugging
 #
 def dump_block_list( list ):
     """dump a comment block list"""
     for block in list:
-	print "----------------------------------------"
-	for line in block[0]:
-		print line
-	for line in block[1]:
-		print line
+        print "----------------------------------------"
+        for line in block[0]:
+            print line
+        for line in block[1]:
+            print line
 
     print "---------the end-----------------------"
 
@@ -271,77 +270,86 @@ def dump_block_list( list ):
 #
 class DocCode:
 
-    def __init__(self,margin=0):
-	self.lines  = []
-	self.margin = margin 
-	
-    def	add(self,line):
+    def __init__( self, margin = 0 ):
+        self.lines  = []
+        self.margin = margin 
+        
+    def add( self, line ):
         # remove margin whitespace
-        if string.strip( line[:self.margin] ) == "": line = line[self.margin:]
-        self.lines.append(line)
+        if string.strip( line[: self.margin] ) == "":
+            line = line[self.margin :]
+        self.lines.append( line )
 
     
-    def dump(self):
+    def dump( self ):
 
-	max_width = 50
+        max_width = 50
 
         for line in self.lines:
             print "--" + line
 
-	print ""
+        print ""
 
 
-    def dump_html(self):
+    def dump_html( self ):
     
         # clean the last empty lines
-        l = len(self.lines)-1
-        while (len > 0) and string.strip(lines[len-1])=="":
-          len = len-1
+        l = len( self.lines ) - 1
+        while len > 0 and string.strip( lines[len - 1] ) == "":
+            len = len - 1
 
         print code_header
-        for line in self.lines[0:len]:
+        for line in self.lines[0 : len]:
             print lines
         print code_footer
 
 
 ##############################################################################
 #
-# The DocParagraph is used to store either simple text paragraphs
+# The DocParagraph is used to store text paragraphs
 # self.words is simply a list of words for the paragraph
 #
 class DocParagraph:
 
-    def __init__(self):
-	self.words  = []
-	
-    def	add(self,line):
+    def __init__( self ):
+        self.words = []
+        
+    def add( self, line ):
         # get rid of unwanted spaces in the paragraph
-        self.words.extend( string.split(line) )
-	
+        #
+        # the following line is the same as
+        #
+        #   self.words.extend( string.split( line ) )
+        #
+        # but older Python versions don't have the `extend' attribute
+        #
+        self.words[len( self.words ) : len( self.words )] = \
+          string.split( line )
+        
     
-    def dump(self):
+    def dump( self ):
 
-	max_width = 50
+        max_width = 50
         cursor    = 0
         line      = ""
         
         for word in self.words:
     
-	    if cursor+len(word)+1 > max_width:
-	        print line
-	        cursor = 0
-	        line = ""
+            if cursor + len( word ) + 1 > max_width:
+                print line
+                cursor = 0
+                line = ""
     
-	    line   = line + word + " "
-	    cursor = cursor + len(word) + 1
-	    
+            line   = line + word + " "
+            cursor = cursor + len( word ) + 1
+            
         if cursor > 0:
-	    print line
+            print line
 
-	print ""
+        print ""
 
 
-    def dump_html(self):
+    def dump_html( self ):
     
         print para_header
         self.dump()
@@ -352,33 +360,31 @@ class DocParagraph:
 #
 # DocContent is used to store the content of a given marker.
 #
-#
-#
 class DocContent:
 
-    def  __init__(self,lines_list):
-        self.items    = []
-        code_mode     = 0
-        code_margin   = 0
-        text          = []
-        paragraph     = None
-        code          = None
-        elements      = []
-        field         = None
-
-	for aline in lines_list:
-	
-	    if code_mode == 0:
-		line   = string.lstrip(aline) 
-	        l      = len(line)
-		margin = len(aline) - l
-
-		# if the line is empty, this is the end of the current
-		# paragraph
-		if l == 0 or line == '{':
+    def __init__( self, lines_list ):
+        self.items  = []
+        code_mode   = 0
+        code_margin = 0
+        text        = []
+        paragraph   = None
+        code        = None
+        elements    = []
+        field       = None
+
+        for aline in lines_list:
+        
+            if code_mode == 0:
+                line   = string.lstrip( aline )
+                l      = len( line )
+                margin = len( aline ) - l
+
+                # if the line is empty, this is the end of the current
+                # paragraph
+                if l == 0 or line == '{':
                 
-		    if paragraph:
-                        elements.append(paragraph)
+                    if paragraph:
+                        elements.append( paragraph )
                         paragraph = None
                     
                     if line == "":
@@ -388,87 +394,87 @@ class DocContent:
                     code_margin = margin
                     code        = None
                     continue
-	    
-		words = string.split(line)
-		
-		# test for a field delimiter on the start of the line, i.e.
-		# the token `::'
-		#
-		if len(words) >= 2 and words[1] == "::":
-		    if paragraph:
-                        elements.append(paragraph)
+            
+                words = string.split( line )
+                
+                # test for a field delimiter on the start of the line, i.e.
+                # the token `::'
+                #
+                if len( words ) >= 2 and words[1] == "::":
+                    if paragraph:
+                        elements.append( paragraph )
                         paragraph = None
 
-                    self.items.append( (field,elements) )
-		
-		    field    = words[0]
-		    elements = []
-		    words    = words[2:]
-			
-		if len(words) > 0:
-		    line = string.join(words)
-		    if not paragraph:
-			paragraph = DocParagraph()
-		    paragraph.add( line )
-	    
-	    else:
-		line = aline
-		
-		# the code block ends with a line that has a single '}' on it
-		if line == " "*code_margin+'}':
+                    self.items.append( ( field, elements ) )
+                
+                    field    = words[0]
+                    elements = []
+                    words    = words[2 :]
+                        
+                if len( words ) > 0:
+                    line = string.join( words )
+                    if not paragraph:
+                        paragraph = DocParagraph()
+                    paragraph.add( line )
+            
+            else:
+                line = aline
+                
+                # the code block ends with a line that has a single '}' on it
+                if line == " " * code_margin + '}':
                 
                     if code:
-                        elements.append(code)
+                        elements.append( code )
                         code = None
                         
-		    code_mode   = 0
-		    code_margin = 0
-		
-		# otherwise, add the line to the current paragraph
-		else:
+                    code_mode   = 0
+                    code_margin = 0
+                
+                # otherwise, add the line to the current paragraph
+                else:
                     if not code:
                         code = DocCode()
-		    code.add(line)
-	
-	if paragraph:
-	    elements.append(paragraph)
+                    code.add( line )
+        
+        if paragraph:
+            elements.append( paragraph )
 
         if code:
-            elements.append(code)
-	    
-	self.items.append( (field,elements) )
+            elements.append( code )
+            
+        self.items.append( ( field, elements ) )
 
 
 
-    def dump(self):
-	for item in self.items:
+    def dump( self ):
+        for item in self.items:
             field = item[0]
-	    if field:
-                print "<field "+field+">"
+            if field:
+                print "<field " + field + ">"
 
-	    for element in item[1]:
+            for element in item[1]:
                 element.dump()
-	    
-	    if field:
-                print "</field>	"
+            
+            if field:
+                print "</field>        "
 
-    def dump_html(self):
+    def dump_html( self ):
         
-        n        = len(self.items)
+        n        = len( self.items )
         in_table = 0
         
-        for i in range(n):
+        for i in range( n ):
             item  = self.items[i]
             field = item[0]
             
             if not field:
             
                 if in_table:
-                  print "</td></tr></table>"
-                  in_table = 0
+                    print "</td></tr></table>"
+                    in_table = 0
                   
                 for element in item[1]:
-                  element.dump_html()
+                    element.dump_html()
             else:
                 if not in_table:
                     print "<table cellpadding=4><tr valign=top><td>"
@@ -476,7 +482,7 @@ class DocContent:
                 else:
                     print "</td></tr><tr valign=top><td>"
                 
-                print "<b>"+field+"</b></td><td>"
+                print "<b>" + field + "</b></td><td>"
                 
                 for element in item[1]:
                     element.dump_html()
@@ -484,6 +490,7 @@ class DocContent:
         if in_table:
             print "</td></tr></table>"
 
+
 ######################################################################################
 #
 #
@@ -493,9 +500,9 @@ class DocContent:
 #
 class DocBlock:
 
-    def __init__(self, block_line_list=[], source_line_list=[]):
-	self.markers  = []
-	self.contents = []
+    def __init__( self, block_line_list = [], source_line_list = [] ):
+        self.markers  = []
+        self.contents = []
         self.source   = source_line_list
     
         marker   = ""
@@ -503,62 +510,65 @@ class DocBlock:
         alphanum = string.letters + string.digits + "_"
     
         for line in block_line_list:
-    	    line2  = string.lstrip(line)
-	    l      = len(line2)
-	    margin = len(line) - l
-	
-	    if l > 3 and line2[0] == '<':
-	        i = 1
-	        while i < l and line2[i] in alphanum: i = i+1
-	        if i < l and line2[i] == '>':
-		    if marker or content:
-    			self.add( marker, content )
-		    marker  = line2[1:i]
-		    content = []
-		    line2   = string.lstrip(line2[i+1:])
-		    l       = len(line2)
-		    line    = " "*margin + line2
-	
-	    content.append(line)
-	
-	if marker or content:
-	    self.add( marker, content )
-	
-	
+            line2  = string.lstrip( line )
+            l      = len( line2 )
+            margin = len( line ) - l
+        
+            if l > 3 and line2[0] == '<':
+                i = 1
+                while i < l and line2[i] in alphanum:
+                    i = i + 1
+                if i < l and line2[i] == '>':
+                    if marker or content:
+                        self.add( marker, content )
+                    marker  = line2[1 : i]
+                    content = []
+                    line2   = string.lstrip( line2[i + 1 :] )
+                    l       = len( line2 )
+                    line    = " " * margin + line2
+        
+            content.append( line )
+        
+        if marker or content:
+            self.add( marker, content )
+        
+        
     def add( self, marker, lines ):
     
-	# remove the first and last empty lines from the content list
-	l = len(lines)
-	if l > 0:
-	    i = 0
-	    while l > 0 and string.strip(lines[l-1]) == "": l = l-1
-	    while i < l and string.strip(lines[i]) == "": i = i+1
-	    lines = lines[i:l]
-	    l     = len(lines)
-	    
-	# add a new marker only if its marker and its content list aren't empty
-	if l > 0 and marker:
-	    self.markers.append(marker)
-	    self.contents.append(lines)
+        # remove the first and last empty lines from the content list
+        l = len( lines )
+        if l > 0:
+            i = 0
+            while l > 0 and string.strip( lines[l - 1] ) == "":
+                l = l - 1
+            while i < l and string.strip( lines[i] ) == "":
+                i = i + 1
+            lines = lines[i : l]
+            l     = len( lines )
+            
+        # add a new marker only if its marker and its content list aren't empty
+        if l > 0 and marker:
+            self.markers.append( marker )
+            self.contents.append( lines )
 
     def dump( self ):
-	for i in range( len(self.markers) ):
-	    print "["+self.markers[i]+"]"
-	    for line in self.contents[i]:
-		print "-- "+line
+        for i in range( len( self.markers ) ):
+            print "[" + self.markers[i] + "]"
+            for line in self.contents[i]:
+                print "-- " + line
 
-    def doc_contents(self):
-	contents = []
-	for item in self.contents:
-	  contents.append( DocContent(item) )
-	return contents
+    def doc_contents( self ):
+        contents = []
+        for item in self.contents:
+          contents.append( DocContent( item ) )
+        return contents
 
 
 def dump_doc_blocks( block_list ):
     for block in block_list:
-	docblock = DocBlock(block)
-	docblock.dump()
-	print "<<------------------->>"
+        docblock = DocBlock( block )
+        docblock.dump()
+        print "<<------------------->>"
 
 
 #
@@ -566,64 +576,68 @@ def dump_doc_blocks( block_list ):
 #
 def dump_single_content( block_list ):
 
-    block = block_list[0]
-    docblock = DocBlock(block)
+    block    = block_list[0]
+    docblock = DocBlock( block )
 
     print "<block>"
-    for i in range(len(docblock.markers)):
-	marker   = docblock.markers[i]
-	contents = docblock.contents[i]
-	
-	print "<marker "+marker+">"
-	doccontent = DocContent( contents )
-
-	doccontent.dump()
-		
-	print "</marker>"
-	
+    for i in range( len( docblock.markers ) ):
+        marker   = docblock.markers[i]
+        contents = docblock.contents[i]
+        
+        print "<marker " + marker + ">"
+        doccontent = DocContent( contents )
+
+        doccontent.dump()
+                
+        print "</marker>"
+        
     print "</block>"        
 
+
 def dump_doc_contents( block_list ):
 
     for block in block_list:
-	docblock = DocBlock(block)
-	print "<block>"
-	
-	for i in range(len(docblock.markers)):
-	    print "<marker "+docblock.markers[i]+">"
-	    content = DocContent( docblock.contents[i] )
-	    content.dump()
-	    print "</marker>"
-	print "</block>"
+        docblock = DocBlock( block )
+        print "<block>"
+        
+        for i in range( len( docblock.markers ) ):
+            print "<marker " + docblock.markers[i] + ">"
+            content = DocContent( docblock.contents[i] )
+            content.dump()
+            print "</marker>"
+        print "</block>"
+
 
 def dump_html_1( block_list ):
     
     print html_header
     
-    types = [ 'Type', 'Struct', 'FuncType', 'Function', 'Constant', 'Enumeration' ]
+    types = [ 'Type', 'Struct', 'FuncType', 'Function', 'Constant',
+              'Enumeration' ]
+
     for block in block_list:
     
-          docblock = DocBlock(block[0],block[1])
+          docblock = DocBlock( block[0], block[1] )
           
-          if len(docblock.markers) == 0:
+          if len( docblock.markers ) == 0:
               continue
 
           print block_header
 
-          for i in range(len(docblock.markers)):
+          for i in range( len( docblock.markers ) ):
               marker   = docblock.markers[i]
               content  = docblock.contents[i]
               dcontent = DocContent( content )
               
-              if marker=="Description":
+              if marker == "Description":
                   print "<ul><p>"
                   dcontent.dump()
                   print "</p></ul>"
                   
               elif marker in types:
-                  print "<h3><font color=blue>"+content[0]+"</font></h3>"
+                  print "<h3><font color=blue>" + content[0] + "</font></h3>"
               else:
-                  print "<h4>"+marker+"</h4>"
+                  print "<h4>" + marker + "</h4>"
                   print "<ul><p>"
                   dcontent.dump_html()
                   print "</p></ul>"
@@ -634,27 +648,29 @@ def dump_html_1( block_list ):
                         
           # print source code
           lines = block[1]
-          l     = len(lines)-1
-          while (l >= 0) and string.strip(lines[l])=="":
-            l = l-1
+          l     = len( lines ) - 1
+          while l >= 0 and string.strip( lines[l] ) == "":
+            l = l - 1
           print source_header
-          for line in lines[0:l+1]:
+          for line in lines[0 : l + 1]:
             print  line
           print source_footer
               
     print html_footer
 
-    
-    
 
 
-def main(argv):
+def main( argv ):
     """main program loop"""
-    print "extracting comment blocks from sources .."
+    sys.stderr.write( "extracting comment blocks from sources...\n" )
     list = make_block_list()
     
     dump_html_1( list )
 
 
 # If called from the command line
-if __name__=='__main__': main(sys.argv)
+if __name__ == '__main__':
+    main( sys.argv )
+
+
+# eof
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 29316c6..0c1548a 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -325,6 +325,8 @@
   /*    Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */
   /*    all character codes must be expressed as FT_Longs.                 */
   /*                                                                       */
+  /*    Other encodings might be defined in the future.                    */
+  /*                                                                       */
   typedef enum  FT_Encoding_
   {
     ft_encoding_none    = 0,
@@ -343,8 +345,6 @@
 
     ft_encoding_apple_roman    = FT_MAKE_TAG( 'a', 'r', 'm', 'n' )
 
-    /* other encodings might be defined in the future */
-
   } FT_Encoding;