Skip to content

Commit

Permalink
Rename Entry in the configuration_subsystem to SettingsEntry (a…
Browse files Browse the repository at this point in the history
…nsible#774)

Rename `Entry` in the `configuration_subsystem` to `SettingsEntry`

Also EntryValue to SettingsEntryValue

update code as needed
fix for new mypy error resulting from type in post processor

This should eliminate a subset of the docs errors, as Entry was defined in the tokenization subsystem as well.
The use of settings vs configuration was done as over time the use of configuration within navigator should slowly be replace with settings to avoid confusion with ansible.

Reviewed-by: Sorin Sbarnea <sorin.sbarnea@gmail.com>
Reviewed-by: None <None>
  • Loading branch information
cidrblock committed Jan 19, 2022
1 parent 3ebe2b2 commit 1ae2b4d
Show file tree
Hide file tree
Showing 9 changed files with 183 additions and 152 deletions.
4 changes: 2 additions & 2 deletions docs/_ext/single_sourced_data.py
Expand Up @@ -22,7 +22,7 @@
from ansible_navigator import __version__
from ansible_navigator.configuration_subsystem import NavigatorConfiguration
from ansible_navigator.configuration_subsystem import Constants as C
from ansible_navigator.configuration_subsystem.definitions import Entry
from ansible_navigator.configuration_subsystem.definitions import SettingsEntry
from ansible_navigator.utils import oxfordcomma


Expand Down Expand Up @@ -162,7 +162,7 @@ def _params_retrieve_details(filename: str) -> Dict:
return yaml.load(fhand, Loader=yaml.SafeLoader)


def _params_row_for_entry(entry: Entry, param_details: Dict) -> Tuple:
def _params_row_for_entry(entry: SettingsEntry, param_details: Dict) -> Tuple:
# pylint: disable=too-many-branches
"""create a row entry for a param"""
if entry.cli_parameters is None:
Expand Down
2 changes: 1 addition & 1 deletion src/ansible_navigator/configuration_subsystem/__init__.py
Expand Up @@ -3,5 +3,5 @@
from .configurator import Configurator
from .definitions import ApplicationConfiguration
from .definitions import Constants
from .definitions import Entry
from .definitions import SettingsEntry
from .navigator_configuration import NavigatorConfiguration
12 changes: 6 additions & 6 deletions src/ansible_navigator/configuration_subsystem/definitions.py
Expand Up @@ -45,7 +45,7 @@ class Constants(Enum):
USER_CLI = "cli parameters"


class EntryValue(SimpleNamespace):
class SettingsEntryValue(SimpleNamespace):
# pylint: disable=too-few-public-methods
"""An object to store a value"""

Expand All @@ -54,7 +54,7 @@ class EntryValue(SimpleNamespace):
source: Constants = Constants.NOT_SET


class Entry(SimpleNamespace):
class SettingsEntry(SimpleNamespace):
# pylint: disable=too-few-public-methods
"""One entry in the configuration
Expand All @@ -68,11 +68,11 @@ class Entry(SimpleNamespace):
short_description: A short description used for the argparse help
subcommand_value: Does the hold the names of the subcommand
subcommands: which subcommand should this be used for
value: the EntryValue for the entry
value: the SettingsEntryValue for the entry
"""
name: str
short_description: str
value: EntryValue
value: SettingsEntryValue

apply_to_subsequent_cli: Constants = Constants.ALL
change_after_initial: bool = True
Expand Down Expand Up @@ -135,7 +135,7 @@ class ApplicationConfiguration(SimpleNamespace):
"""The main object for storing an application config"""

application_name: str = ""
entries: List[Entry] = []
entries: List[SettingsEntry] = []
internals: SimpleNamespace
subcommands: List[SubCommand]
post_processor = Callable
Expand All @@ -155,7 +155,7 @@ def __getattribute__(self, attr: str) -> Any:
except KeyError:
return super().__getattribute__(attr)

def entry(self, name) -> Entry:
def entry(self, name) -> SettingsEntry:
"""Retrieve a configuration entry by name"""
return self._get_by_name(name, "entries")

Expand Down

0 comments on commit 1ae2b4d

Please sign in to comment.