backport stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 04 Mar 2010 10:58:28 +0100
changeset 4793 fdb5476dee9a
parent 4790 52c81aef0b61 (current diff)
parent 4792 e46c6e01117b (diff)
child 4795 f1c8bc628b45
backport stable
server/schemaserial.py
server/test/unittest_schemaserial.py
--- a/server/schemaserial.py	Thu Mar 04 10:23:20 2010 +0100
+++ b/server/schemaserial.py	Thu Mar 04 10:58:28 2010 +0100
@@ -55,6 +55,7 @@
     return dict(cursor.execute('Any T, X WHERE X is CWConstraintType, X name T'))
 
 # schema / perms deserialization ##############################################
+
 def deserialize_schema(schema, session):
     """return a schema according to information stored in an rql database
     as CWRType and CWEType entities
@@ -219,9 +220,10 @@
         print _title,
     execute = cursor.unsafe_execute
     eschemas = schema.entities()
-    aller = eschemas + schema.relations()
     if not quiet:
-        pb_size = len(aller) + len(CONSTRAINTS) + len([x for x in eschemas if x.specializes()])
+        pb_size = (len(eschemas + schema.relations())
+                   + len(CONSTRAINTS)
+                   + len([x for x in eschemas if x.specializes()]))
         pb = ProgressBar(pb_size, title=_title)
     else:
         pb = None
@@ -260,7 +262,7 @@
         if pb is not None:
             pb.update()
     for rql, kwargs in specialize2rql(schema):
-        assert execute(rql, kwargs, build_descr=False)
+        execute(rql, kwargs, build_descr=False)
         if pb is not None:
             pb.update()
     if not quiet: