[massive store] Drop dead code
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 04 Oct 2016 13:14:18 +0200
changeset 11782 056004c17c71
parent 11781 4ebd968f364c
child 11783 8865c9e55575
[massive store] Drop dead code This function is never used
cubicweb/dataimport/massive_store.py
--- a/cubicweb/dataimport/massive_store.py	Fri Sep 30 17:34:59 2016 +0200
+++ b/cubicweb/dataimport/massive_store.py	Tue Oct 04 13:14:18 2016 +0200
@@ -25,8 +25,6 @@
 
 from six.moves import range
 
-from yams.constraints import SizeConstraint
-
 from cubicweb.dataimport import stores, pgstore
 
 
@@ -334,29 +332,6 @@
                  % (rtype, eid_to, etype.lower()))
 
 
-def get_size_constraints(schema):
-    """analyzes yams ``schema`` and returns the list of size constraints.
-
-    The returned value is a dictionary mapping entity types to a
-    sub-dictionnaries mapping attribute names -> max size.
-    """
-    size_constraints = {}
-    # iterates on all entity types
-    for eschema in schema.entities():
-        # for each entity type, iterates on attribute definitions
-        size_constraints[eschema.type] = eschema_constraints = {}
-        for rschema, aschema in eschema.attribute_definitions():
-            # for each attribute, if a size constraint is found,
-            # append it to the size constraint list
-            maxsize = None
-            rdef = rschema.rdef(eschema, aschema)
-            for constraint in rdef.constraints:
-                if isinstance(constraint, SizeConstraint):
-                    maxsize = constraint.max
-                    eschema_constraints[rschema.type] = maxsize
-    return size_constraints
-
-
 def get_default_values(schema):
     """analyzes yams ``schema`` and returns the list of default values.