Merge ~sylvain-pineau/checkbox-ng:fix-resource-split_and_evaluate into checkbox-ng:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: dfd2738cf930cc00ded0b7ab2f7214660256a10f
Merged at revision: 241ee6f56f3684f2ff64841d89cec167c0ef2357
Proposed branch: ~sylvain-pineau/checkbox-ng:fix-resource-split_and_evaluate
Merge into: checkbox-ng:master
Diff against target: 13 lines (+1/-1)
1 file modified
plainbox/impl/resource.py (+1/-1)
Reviewer Review Type Date Requested Status
Maciej Kisielewski (community) Approve
Review via email: mp+390138@code.launchpad.net

Description of the change

Turns out the split_and_evaluate never really worked as expected with the following enter condition:

if not '(' in self._text and ')' in self._text:

To post a comment you must log in.
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

thanks for fixing my mistake :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/plainbox/impl/resource.py b/plainbox/impl/resource.py
2index 22446ac..38f3d59 100644
3--- a/plainbox/impl/resource.py
4+++ b/plainbox/impl/resource.py
5@@ -636,7 +636,7 @@ class ResourceExpression:
6 # if parenthesis are used in the expression then there's a high chance
7 # we'll break the syntax with a bruteforce split on operator. Let's
8 # not do a split on exprs with parenthesis
9- if not '(' in self._text and ')' in self._text:
10+ if not '(' in self._text:
11 or_pos = self._text.rfind(' or ')
12 if or_pos > 0:
13 lhs, rhs = self._split_and_evaluate(' or ', resource_map)

Subscribers

People subscribed via source and target branches