Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/boolean triggers #38

Merged
merged 9 commits into from
Mar 8, 2019
Merged

Bugfix/boolean triggers #38

merged 9 commits into from
Mar 8, 2019

Conversation

OrBin
Copy link
Owner

@OrBin OrBin commented Mar 1, 2019

No description provided.

OrBin and others added 4 commits March 1, 2019 00:29
Fixed an issue with ruamel_yaml imports
# Conflicts:
#	gramhopper/configuration/boolean_helper.py
#	gramhopper/configuration/rules_parsing_helper.py
@OrBin OrBin requested a review from meirhalachmi March 1, 2019 20:54
@@ -22,7 +22,9 @@ def parse_single(cls, config, global_elements): # pylint: disable=unused-argume
mapping_cls = cls.mapping_class()
element_cls = mapping_cls[config_copy.pop('type')]

return element_cls(**config_copy)
if isclass(element_cls):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some triggers are classes (most of them actually), but some are instances (mostly filter triggers). This allows both cases to be used.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. Then the name "element_cls" isn't so good.
Additionally, why do we have this ambiguity?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. You are right. I'll rename.
  2. Filter triggers are mostly instances of FilterBasedTrigger receiving BaseFilter. I could have created some lambda to make it feel like a class constructor, but it would make filter_trigger.py look like shit.

@meirhalachmi meirhalachmi merged commit 3d46324 into dev Mar 8, 2019
@meirhalachmi meirhalachmi deleted the bugfix/boolean-triggers branch March 8, 2019 15:48
@OrBin OrBin mentioned this pull request Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants