[vreg] move base registry implementation to logilab.common. Closes #1916014
A new logilab.common.registry module has been created with content from
* cw.vreg (the whole things that was in there)
* cw.appobject (base selectors and all).
In the process, we've done some renaming:
* former selector functions are now known as "predicate", though you still
use predicates to build an object'selector
* hence `objectify_selector` decorator is now `objectify_predicate`
* the top level registry is now `RegistryStore` (was `VRegistry`)
Also there is no more need for the @lltrace decorator.
On the CubicWeb side, the `selectors` module has been renamed to `predicates`.
There should be full backward compat with proper deprecation warnings.
functiondatetuple(d){return[d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes()];}functionpprint(obj){print('{');for(kinobj){print(' '+k+' = '+obj[k]);}print('}');}functionarrayrepr(array){return'['+array.join(', ')+']';}functionassertArrayEquals(array1,array2){if(array1.length!=array2.length){thrownewcrosscheck.AssertionFailure(array1.join(', ')+' != '+array2.join(', '));}for(vari=0;i<array1.length;i++){if(array1[i]!=array2[i]){thrownewcrosscheck.AssertionFailure(arrayrepr(array1)+' and '+arrayrepr(array2)+' differs at index '+i);}}}