from__future__importprint_functionconfig['rql-cache-size']=config['rql-cache-size']*10add_entity_type('CWDataImport')fromcubicweb.schemaimportCONSTRAINTS,guess_rrqlexpr_mainvarsforrqlcstrinrql('Any X,XT,XV WHERE X is CWConstraint, X cstrtype XT, X value XV,''X cstrtype XT, XT name IN ("RQLUniqueConstraint","RQLConstraint","RQLVocabularyConstraint"),''NOT X value ~= ";%"').entities():expression=rqlcstr.valuemainvars=guess_rrqlexpr_mainvars(expression)yamscstr=CONSTRAINTS[rqlcstr.type](expression,mainvars)rqlcstr.cw_set(value=yamscstr.serialize())print('updated',rqlcstr.type,rqlcstr.value.strip())