Skip to content

Commit

Permalink
Merge pull request #12019 from marcusburghardt/extend_profile_class
Browse files Browse the repository at this point in the history
Extend the Profile class in profile_tool
  • Loading branch information
jan-cerny committed May 28, 2024
2 parents a2f912a + 67365a7 commit ba23956
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit ba23956

Please sign in to comment.