# HG changeset patch # User Sylvain Thénault # Date 1475579658 -7200 # Node ID 056004c17c715a517551b9ad0216efb607b07af7 # Parent 4ebd968f364c345e74dd94d964f93747c9951e23 [massive store] Drop dead code This function is never used diff -r 4ebd968f364c -r 056004c17c71 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.