Skip to content

Commit

Permalink
fixing the __repr__ for the plugin manager
Browse files Browse the repository at this point in the history
  • Loading branch information
brifordwylie committed Jan 31, 2024
1 parent 225b058 commit 5a54a55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/sageworks/core/artifacts/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ def base_compliant_uuid(cls, uuid: str, delimiter: str = "_") -> str:
clean_uuid = clean_uuid.replace("-", delimiter)
if uuid != clean_uuid:
log = logging.getLogger("sageworks")
log.warning("UUIDs have constraints and are suppose to conform to things like, lower case,etc)")
log.warning(f"{uuid} doesn't conform and should be converted to something like: {clean_uuid}")
log.warning("UUIDs have constraints (lower case, etc) to minimize downstream issues.")
log.warning(f"{uuid} doesn't conform and should be converted to: {clean_uuid}")
return uuid
return clean_uuid

Expand Down
13 changes: 9 additions & 4 deletions src/sageworks/utils/plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ def get_all_plugins(self) -> Dict[str, dict[Any]]:
Retrieve a dictionary of all plugins.
Returns:
Dict[str, dict]: A dictionary of all plugins (keyed by plugin type).
Dict[str, dict]: A dictionary of all plugins.
{'pages': {name: plugin, name2: plugin2,...
'views': {name: plugin, name2: plugin2,...},
"""
return self.plugins

Expand Down Expand Up @@ -158,9 +160,9 @@ def __repr__(self) -> str:
"""
summary = "SAGEWORKS_PLUGINS: " + self.plugin_dir + "\n"
summary += "Plugins:\n"
for plugin_type, plugins in self.plugins.items():
for plugin in plugins:
summary += f" {plugin_type}: {plugin.__name__}\n"
for plugin_type, plugin_dict in self.plugins.items():
for name, plugin in plugin_dict.items():
summary += f" {plugin_type}: {name}: {plugin}\n"
return summary


Expand All @@ -185,3 +187,6 @@ def __repr__(self) -> str:

# Get all the plugins
pprint(manager.get_all_plugins())

# Test REPR
print(manager)

0 comments on commit 5a54a55

Please sign in to comment.