Skip to content

Commit

Permalink
Rename add_option to add_group and add_groups
Browse files Browse the repository at this point in the history
The name of the method in different classes was the same, although each
one did another thing. Renamed some of them to reflect the actual task.
  • Loading branch information
Felixoid committed Oct 18, 2024
1 parent 36924b6 commit 3c3cea4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion did/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self, arguments=None):
# Create sample stats and include all stats objects options
log.debug("Loading Sample Stats group to build Options")
self.sample_stats = UserStats()
self.sample_stats.add_option(self.parser)
self.sample_stats.add_groups(self.parser)
log.info("Default command line: did {0}".format(" ".join(
[f'--{stat.option}' for stat in self.sample_stats.stats])))

Expand Down
6 changes: 3 additions & 3 deletions did/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class StatsGroup(Stats, metaclass=StatsGroupPlugin):
# Default order
order = 500

def add_option(self, parser):
def add_group(self, parser):
""" Add option group and all children options. """

group = parser.add_argument_group(self.name)
Expand Down Expand Up @@ -240,10 +240,10 @@ def configured_plugins(self, config):
results.append(obj)
return sorted(results, key=lambda x: x.order)

def add_option(self, parser):
def add_groups(self, parser):
""" Add options for each stats group. """
for stat in self.stats:
stat.add_option(parser)
stat.add_group(parser)

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Header & Footer
Expand Down

0 comments on commit 3c3cea4

Please sign in to comment.