diff emeraldtree/TidyTools.py @ 47:e647f30cc08e

remove backwards compat code for python < 2.4
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 03 Aug 2008 20:59:44 +0200
parents 7b33b90de8be
children
line wrap: on
line diff
--- a/emeraldtree/TidyTools.py	Sun Jul 27 20:57:32 2008 +0200
+++ b/emeraldtree/TidyTools.py	Sun Aug 03 20:59:44 2008 +0200
@@ -19,7 +19,7 @@
 # utility.
 ##
 
-import glob, string, os, sys
+import glob, os, sys
 
 from ElementTree import ElementTree, Element
 
@@ -40,13 +40,13 @@
 
     if new_inline_tags:
         command.append("--new-inline-tags")
-        command.append(string.join(new_inline_tags, ","))
+        command.append(",".join(new_inline_tags))
 
     # FIXME: support more tidy options!
 
     # convert
     os.system(
-        "%s %s >%s.out 2>%s.err" % (string.join(command), file, file, file)
+        "%s %s >%s.out 2>%s.err" % (" ".join(command), file, file, file)
         )
     # check that the result is valid XML
     try:
@@ -110,9 +110,9 @@
     if body is None:
         return
 
-    if body.text and string.strip(body.text):
+    if body.text and body.text.strip():
         title = Element("h1")
-        title.text = string.strip(body.text)
+        title.text = body.text.strip()
         title.tail = "\n\n"
         body.insert(0, title)