[Python-checkins] CVS: python/dist/src/Doc/perl python.perl,1.107,1.108

Fred L. Drake fdrake@users.sourceforge.net
Thu, 16 Aug 2001 14:56:26 -0700


Update of /cvsroot/python/python/dist/src/Doc/perl
In directory usw-pr-cvs1:/tmp/cvs-serv8888/perl

Modified Files:
	python.perl 
Log Message:

fix_font():  Instead of using a long if/elsif cluster, use a bloody
    dictionary.  Added some entries to the dictionary to fix part of
    SF bug #451556.


Index: python.perl
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v
retrieving revision 1.107
retrieving revision 1.108
diff -C2 -d -r1.107 -r1.108
*** python.perl	2001/08/03 18:36:17	1.107
--- python.perl	2001/08/16 21:56:24	1.108
***************
*** 1183,1213 ****
  @col_aligns = ('<td>', '<td>', '<td>', '<td>', '<td>');
  
  sub fix_font{
      # do a little magic on a font name to get the right behavior in the first
      # column of the output table
      my $font = @_[0];
!     if ($font eq 'textrm') {
! 	$font = '';
!     }
!     elsif ($font eq 'file' || $font eq 'filenq') {
! 	$font = 'tt class="file"';
!     }
!     elsif ($font eq 'member') {
!         $font = 'tt class="member"';
!     }
!     elsif ($font eq 'class') {
!         $font = 'tt class="class"';
!     }
!     elsif ($font eq 'constant') {
!         $font = 'tt class="constant"';
!     }
!     elsif ($font eq 'kbd') {
!         $font = 'kbd';
!     }
!     elsif ($font eq 'programopt') {
!         $font = 'b';
!     }
!     elsif ($font eq 'exception') {
!         $font = 'tt class="exception"';
      }
      return $font;
--- 1183,1206 ----
  @col_aligns = ('<td>', '<td>', '<td>', '<td>', '<td>');
  
+ %FontConversions = ('cdata' => 'tt class="cdata"',
+                     'character' => 'tt class="character"',
+                     'class' => 'tt class="class"',
+                     'command' => 'code',
+                     'constant' => 'tt class="constant"',
+                     'exception' => 'tt class="exception"',
+                     'file' => 'tt class="file"',
+                     'filenq' => 'tt class="file"',
+                     'kbd' => 'kbd',
+                     'member' => 'tt class="member"',
+                     'programopt' => 'b',
+                     'textrm' => '',
+                     );
+ 
  sub fix_font{
      # do a little magic on a font name to get the right behavior in the first
      # column of the output table
      my $font = @_[0];
!     if (defined $FontConversions{$font}) {
!         $font = $FontConversions{$font};
      }
      return $font;