Simplify oe_filter and oe_filter_out by using the filter() python function.
authorChris Larson <clarson@kergoth.com>
Thu, 16 Sep 2004 02:22:08 +0000 (02:22 +0000)
committerChris Larson <clarson@kergoth.com>
Thu, 16 Sep 2004 02:22:08 +0000 (02:22 +0000)
BKrev: 4148f8d01xum7PhEwpKyjez-QS0XSw

classes/base.oeclass

index 508dbd5..cb8d59d 100644 (file)
@@ -41,19 +41,11 @@ FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/$
 
 def oe_filter(f, str, d):
        from re import match
-       ret = []
-       for w in str.split():
-               if match(f, w, 0):
-                       ret += [ w ]
-       return " ".join(ret)
+       return " ".join(filter(lambda x: match(f, x, 0), str.split()))
 
 def oe_filter_out(f, str, d):
        from re import match
-       ret = []
-       for w in str.split():
-               if not match(f, w, 0):
-                       ret += [ w ]
-       return " ".join(ret)
+       return " ".join(filter(lambda x: not match(f, x, 0), str.split()))
 
 die() {
        oefatal "$*"