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

Extend the Profile class in profile_tool #12019

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions utils/profile_tool/profile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from ..controleval import get_parameter_from_yaml


Expand Down Expand Up @@ -43,14 +44,20 @@ def __init__(self, path, title):
self.path = path
self.title = title
self.rules = []
self.variables = {}
self.unselected_rules = []
profile_file = os.path.basename(path)
self.id = profile_file.split('.profile')[0]

def add_rule(self, rule_id):
if rule_id.startswith("!"):
self.unselected_rules.append(rule_id)
return
if "=" not in rule_id:
self.rules.append(rule_id)
else:
variable_name, variable_value = rule_id.split('=', 1)
self.variables[variable_name] = variable_value

def add_rules(self, rules):
for rule in rules:
Expand Down
Loading