devtools/repotest.py
changeset 10662 10942ed172de
parent 10589 7c23b7de2b8d
child 10663 54b8a1f249fb
equal deleted inserted replaced
10661:e6eb0c7c2e98 10662:10942ed172de
   305 
   305 
   306 def _build_variantes(self, newsolutions):
   306 def _build_variantes(self, newsolutions):
   307     variantes = _orig_build_variantes(self, newsolutions)
   307     variantes = _orig_build_variantes(self, newsolutions)
   308     sortedvariantes = []
   308     sortedvariantes = []
   309     for variante in variantes:
   309     for variante in variantes:
   310         orderedkeys = sorted((k[1], k[2], v) for k, v in variante.iteritems())
   310         orderedkeys = sorted((k[1], k[2], v) for k, v in variante.items())
   311         variante = DumbOrderedDict(sorted(variante.iteritems(),
   311         variante = DumbOrderedDict(sorted(variante.items(),
   312                                           lambda a, b: cmp((a[0][1],a[0][2],a[1]),
   312                                           lambda a, b: cmp((a[0][1],a[0][2],a[1]),
   313                                                            (b[0][1],b[0][2],b[1]))))
   313                                                            (b[0][1],b[0][2],b[1]))))
   314         sortedvariantes.append( (orderedkeys, variante) )
   314         sortedvariantes.append( (orderedkeys, variante) )
   315     return [v for ok, v in sorted(sortedvariantes)]
   315     return [v for ok, v in sorted(sortedvariantes)]
   316 
   316 
   317 from cubicweb.server.querier import ExecutionPlan
   317 from cubicweb.server.querier import ExecutionPlan
   318 _orig_check_permissions = ExecutionPlan._check_permissions
   318 _orig_check_permissions = ExecutionPlan._check_permissions
   319 
   319 
   320 def _check_permissions(*args, **kwargs):
   320 def _check_permissions(*args, **kwargs):
   321     res, restricted = _orig_check_permissions(*args, **kwargs)
   321     res, restricted = _orig_check_permissions(*args, **kwargs)
   322     res = DumbOrderedDict(sorted(res.iteritems(), lambda a, b: cmp(a[1], b[1])))
   322     res = DumbOrderedDict(sorted(res.items(), lambda a, b: cmp(a[1], b[1])))
   323     return res, restricted
   323     return res, restricted
   324 
   324 
   325 def _dummy_check_permissions(self, rqlst):
   325 def _dummy_check_permissions(self, rqlst):
   326     return {(): rqlst.solutions}, set()
   326     return {(): rqlst.solutions}, set()
   327 
   327