vregistry.py
changeset 623 9dc7b3fa59f1
parent 615 38bc11ac845b
child 646 8a9551089912
--- 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