Skip to content

Commit

Permalink
Satisfy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
sdruskat committed Jan 14, 2025
1 parent c93739a commit b0c9a89
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/hermes/commands/marketplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,14 @@ def handle_data(self, data):


def _sort_plugins_by_step(plugins: list[SchemaOrgSoftwareApplication]) -> dict[str, list[SchemaOrgSoftwareApplication]]:
sorted_plugins = {k:[] for k in ["harvest", "process", "curate", "deposit", "postprocess"]}
sorted_plugins = {k: [] for k in ["harvest", "process", "curate", "deposit", "postprocess"]}
for p in plugins:
for kw in p.keywords:
if kw.startswith("hermes-step-"):
sorted_plugins[kw.removeprefix("hermes-step-")].append(p)
return sorted_plugins



def main():
response = requests.get(MARKETPLACE_URL, headers={"User-Agent": hermes_user_agent})
response.raise_for_status()
Expand All @@ -117,9 +116,9 @@ def _plugin_loc(_plugin: SchemaOrgSoftwareApplication) -> str:
max_name_len = max(map(lambda plugin: len(plugin.name), parser.plugins))
max_loc_len = max(map(lambda plugin: len(_plugin_loc(plugin)), parser.plugins))
row_sep = "-" * (17 + max_name_len + max_loc_len)
print("HERMES step " + "Plugin name" + (" " * (max_name_len -8)) + "Plugin location")
print("HERMES step " + "Plugin name" + (" " * (max_name_len - 8)) + "Plugin location")
print(row_sep)
name_alignment = max(map(lambda plugin: len(plugin.name), parser.plugins))# + 1
name_alignment = max(map(lambda plugin: len(plugin.name), parser.plugins))
plugins_sorted = _sort_plugins_by_step(parser.plugins)
for step in plugins_sorted.keys():
for plugin in plugins_sorted[step]:
Expand Down

0 comments on commit b0c9a89

Please sign in to comment.