changeset 21:7b33b90de8be

some minor coding style cleanups
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 03 Jun 2008 20:40:02 +0200
parents 56cb25aba1e6
children 0aa00b020bc1
files emeraldtree/ElementPath.py emeraldtree/ElementTree.py emeraldtree/TidyTools.py
diffstat 3 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/emeraldtree/ElementPath.py	Sat May 31 21:50:36 2008 +0200
+++ b/emeraldtree/ElementPath.py	Tue Jun 03 20:40:02 2008 +0200
@@ -194,7 +194,8 @@
         if path[:1] == "/":
             raise SyntaxError("cannot use absolute path on element")
         stream = iter(xpath_tokenizer(path))
-        next = stream.next; token = next()
+        next = stream.next
+        token = next()
         selector = []
         while 1:
             try:
--- a/emeraldtree/ElementTree.py	Sat May 31 21:50:36 2008 +0200
+++ b/emeraldtree/ElementTree.py	Tue Jun 03 20:40:02 2008 +0200
@@ -1224,7 +1224,7 @@
 
     def close(self):
         assert len(self._elem) == 0, "missing end tags"
-        assert self._last != None, "missing toplevel element"
+        assert self._last is not None, "missing toplevel element"
         return self._last
 
     def _flush(self):
@@ -1293,7 +1293,8 @@
             from xml.parsers import expat
         except ImportError:
             try:
-                import pyexpat; expat = pyexpat
+                import pyexpat
+                expat = pyexpat
             except ImportError:
                 raise ImportError(
                     "No module named expat; use SimpleXMLTreeBuilder instead"
--- a/emeraldtree/TidyTools.py	Sat May 31 21:50:36 2008 +0200
+++ b/emeraldtree/TidyTools.py	Tue Jun 03 20:40:02 2008 +0200
@@ -78,7 +78,7 @@
 
     # get xhtml tree
     try:
-        tree = apply(tidy, (file,), options)
+        tree = apply(tidy, (file, ), options)
         if tree is None:
             return
     except IOError, v: