equal
deleted
inserted
replaced
1 """some utilities to ease repository testing |
1 """some utilities to ease repository testing |
2 |
2 |
3 This module contains functions to initialize a new repository. |
3 This module contains functions to initialize a new repository. |
4 |
4 |
5 :organization: Logilab |
5 :organization: Logilab |
6 :copyright: 2003-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
6 :copyright: 2003-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
7 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
7 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
8 """ |
8 """ |
9 __docformat__ = "restructuredtext en" |
9 __docformat__ = "restructuredtext en" |
10 |
10 |
11 from pprint import pprint |
11 from pprint import pprint |
247 |
247 |
248 from cubicweb.server import rqlannotation |
248 from cubicweb.server import rqlannotation |
249 _orig_select_principal = rqlannotation._select_principal |
249 _orig_select_principal = rqlannotation._select_principal |
250 |
250 |
251 def _select_principal(scope, relations): |
251 def _select_principal(scope, relations): |
252 return _orig_select_principal(scope, sorted(relations, key=lambda x: x.r_type)) |
252 return _orig_select_principal(scope, relations, |
|
253 _sort=lambda rels: sorted(rels, key=lambda x: x.r_type)) |
253 |
254 |
254 try: |
255 try: |
255 from cubicweb.server.msplanner import PartPlanInformation |
256 from cubicweb.server.msplanner import PartPlanInformation |
256 except ImportError: |
257 except ImportError: |
257 class PartPlanInformation(object): |
258 class PartPlanInformation(object): |