[Python-checkins] CVS: python/dist/src/Doc/tools/sgmlconv esis2sgml.py,1.15,1.16

Fred L. Drake fdrake@users.sourceforge.net
Fri, 28 Sep 2001 09:25:02 -0700


Update of /cvsroot/python/python/dist/src/Doc/tools/sgmlconv
In directory usw-pr-cvs1:/tmp/cvs-serv32657

Modified Files:
	esis2sgml.py 
Log Message:
Convert most uses of the string module to string methods.
(string.join() lives!)


Index: esis2sgml.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/sgmlconv/esis2sgml.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** esis2sgml.py	2001/03/23 17:09:02	1.15
--- esis2sgml.py	2001/09/28 16:25:00	1.16
***************
*** 98,102 ****
              data = escape(data)
              if not inverbatim:
!                 data = string.replace(data, "---", "—")
              ofp.write(data)
              if "\n" in data:
--- 98,102 ----
              data = escape(data)
              if not inverbatim:
!                 data = data.replace("---", "—")
              ofp.write(data)
              if "\n" in data:
***************
*** 140,144 ****
              inverbatim = 0
          elif type == "A":
!             name, type, value = string.split(data, " ", 2)
              name = map_gi(name, _attr_map)
              attrs[name] = esistools.decode(value)
--- 140,144 ----
              inverbatim = 0
          elif type == "A":
!             name, type, value = data.split(" ", 2)
              name = map_gi(name, _attr_map)
              attrs[name] = esistools.decode(value)
***************
*** 166,170 ****
              if not line:
                  break
!             gi = string.strip(line)
              if gi:
                  d[gi] = gi
--- 166,170 ----
              if not line:
                  break
!             gi = line.strip()
              if gi:
                  d[gi] = gi
***************
*** 178,184 ****
  
  def update_gi_map(map, names, fromsgml=1):
!     for name in string.split(names, ","):
          if fromsgml:
!             uncased = string.lower(name)
          else:
              uncased = name
--- 178,184 ----
  
  def update_gi_map(map, names, fromsgml=1):
!     for name in names.split(","):
          if fromsgml:
!             uncased = name.lower()
          else:
              uncased = name
***************
*** 212,216 ****
              xml = 1
          elif opt in ("-a", "--autoclose"):
!             autoclose = string.split(arg, ",")
          elif opt == "--elements-map":
              elem_names = ("%s,%s" % (elem_names, arg))[1:]
--- 212,216 ----
              xml = 1
          elif opt in ("-a", "--autoclose"):
!             autoclose = arg.split(",")
          elif opt == "--elements-map":
              elem_names = ("%s,%s" % (elem_names, arg))[1:]
***************
*** 242,248 ****
          global _normalize_case
          _normalize_case = string.lower
!         update_gi_map(_elem_map, string.split(elem_names, ","))
!         update_gi_map(_attr_map, string.split(attr_names, ","))
!         update_gi_map(_values_map, string.split(value_names, ","))
      else:
          global map_gi
--- 242,248 ----
          global _normalize_case
          _normalize_case = string.lower
!         update_gi_map(_elem_map, elem_names.split(","))
!         update_gi_map(_attr_map, attr_names.split(","))
!         update_gi_map(_values_map, value_names.split(","))
      else:
          global map_gi