cleanup
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 03 Mar 2010 18:31:08 +0100
changeset 4767 74b8e39d4825
parent 4766 162b2b127b15
child 4768 430b89aed996
cleanup
ext/html4zope.py
server/session.py
--- a/ext/html4zope.py	Wed Mar 03 18:30:25 2010 +0100
+++ b/ext/html4zope.py	Wed Mar 03 18:31:08 2010 +0100
@@ -24,12 +24,13 @@
 
 __docformat__ = 'reStructuredText'
 
+import os
+
 from logilab.mtconverter import xml_escape
 
 from docutils import nodes
 from docutils.writers.html4css1 import Writer as CSS1Writer
 from docutils.writers.html4css1 import HTMLTranslator as CSS1HTMLTranslator
-import os
 
 default_level = int(os.environ.get('STX_DEFAULT_LEVEL', 3))
 
--- a/server/session.py	Wed Mar 03 18:30:25 2010 +0100
+++ b/server/session.py	Wed Mar 03 18:31:08 2010 +0100
@@ -585,10 +585,10 @@
     def add_operation(self, operation, index=None):
         """add an observer"""
         assert self.commit_state != 'commit'
-        if index is not None:
+        if index is None:
+            self.pending_operations.append(operation)
+        else:
             self.pending_operations.insert(index, operation)
-        else:
-            self.pending_operations.append(operation)
 
     # querier helpers #########################################################