Boost logo

Boost-Commit :

From: ghost_at_[hidden]
Date: 2007-10-16 01:43:04


Author: vladimir_prus
Date: 2007-10-16 01:43:04 EDT (Tue, 16 Oct 2007)
New Revision: 40071
URL: http://svn.boost.org/trac/boost/changeset/40071

Log:
Implement property.remove.

Text files modified:
   branches/build/python_port/python/boost/build/build/property.py | 34 +++++++++++++++++++---------------
   1 files changed, 19 insertions(+), 15 deletions(-)

Modified: branches/build/python_port/python/boost/build/build/property.py
==============================================================================
--- branches/build/python_port/python/boost/build/build/property.py (original)
+++ branches/build/python_port/python/boost/build/build/property.py 2007-10-16 01:43:04 EDT (Tue, 16 Oct 2007)
@@ -373,21 +373,25 @@
 # validate [ feature.split $(s) ] ;
 # }
 # }
-#
-# # Returns a property sets which include all the elements in 'properties' that
-# # do not have attributes listed in 'attributes'.
-# rule remove ( attributes + : properties * )
-# {
-# local result ;
-# for local e in $(properties)
-# {
-# if ! [ set.intersection $(attributes) : [ feature.attributes $(e:G) ] ]
-# {
-# result += $(e) ;
-# }
-# }
-# return $(result) ;
-# }
+#
+
+def remove(attributes, properties):
+ """Returns a property sets which include all the elements
+ in 'properties' that do not have attributes listed in 'attributes'."""
+
+ result = []
+ for e in properties:
+ attributes_new = feature.attributes(get_grist(e))
+ has_common_features = 0
+ for a in attributes_new:
+ if a in attributes:
+ has_common_features = 1
+ break
+
+ if not has_common_features:
+ result += e
+
+ return result
 #
 # # Returns a property set which include all properties in 'properties' that have
 # # any of 'attributes'.


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk