-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
Fixed an issue with ruamel_yaml imports
# Conflicts: # gramhopper/configuration/boolean_helper.py # gramhopper/configuration/rules_parsing_helper.py
@@ -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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You are right. I'll rename.
- Filter triggers are mostly instances of
FilterBasedTrigger
receivingBaseFilter
. I could have created some lambda to make it feel like a class constructor, but it would make filter_trigger.py look like shit.
No description provided.