Commit bfb0ba58 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

some divergence testers can be only for matching, not for divergence testing....

some divergence testers can be only for matching, not for divergence testing. so we need a way to recognise if a tester is for divergence testing or not.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31126 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9dbaa83d
......@@ -39,6 +39,11 @@ class DivergenceTester:
'type' : 'lines',
'default' : (),
'mode' : 'w' },
{ 'id' : 'testing_provider',
'description' : 'Defines whether a divergence tester acts as a testing provider.',
'type' : 'boolean',
'default' : 0,
'mode' : 'rw' },
{ 'id' : 'matching_provider',
'description' : 'Defines whether a divergence tester acts as a matching provider.',
'type' : 'boolean',
......
......@@ -235,20 +235,14 @@ class RuleMixin:
"""
raise NotImplementedError
def _getDivergenceTesterList(self, exclude_quantity=True):
def _getDivergenceTesterList(self):
"""
Return the applicable divergence testers which must
be used to test movement divergence.
exclude_quantity -- if set to true, do not consider
quantity divergence testers
be used to test movement divergence. (ie. not all
divergence testers of the Rule)
"""
tester_list = self.objectValues(
portal_type=self.getPortalDivergenceTesterTypeList())
if exclude_quantity:
return [x for x in tester_list if x.getTestedProperty() != 'quantity']
else:
return tester_list
return filter(lambda x:x.isTestingProvider(), self.objectValues(
portal_type=self.getPortalDivergenceTesterTypeList()))
def _getMatchingTesterList(self):
"""
......@@ -256,7 +250,8 @@ class RuleMixin:
be used to match movements and build the diff (ie.
not all divergence testers of the Rule)
"""
raise NotImplementedError
return filter(lambda x:x.isMatchingProvider(), self.objectValues(
portal_type=self.getPortalDivergenceTesterTypeList()))
def _getQuantityTesterList(self):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment