diff -r 2d30c5e1a7d2 -r 9dc7b3fa59f1 vregistry.py --- a/vregistry.py Fri Feb 13 16:34:05 2009 +0100 +++ b/vregistry.py Mon Feb 16 11:28:43 2009 +0100 @@ -513,7 +513,7 @@ # advanced selector building functions ######################################## -def chainall(*selectors): +def chainall(*selectors, **kwargs): """return a selector chaining given selectors. If one of the selectors fail, selection will fail, else the returned score will be the sum of each selector'score @@ -527,9 +527,11 @@ return 0 score += partscore return score + if 'name' in kwargs: + selector.__name__ = kwargs['name'] return selector -def chainfirst(*selectors): +def chainfirst(*selectors, **kwargs): """return a selector chaining given selectors. If all the selectors fail, selection will fail, else the returned score will be the first non-zero selector score @@ -541,5 +543,7 @@ if partscore: return partscore return 0 + if 'name' in kwargs: + selector.__name__ = kwargs['name'] return selector