Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/disabledrivers #223

Merged
merged 3 commits into from
Jan 6, 2025
Merged

Feat/disabledrivers #223

merged 3 commits into from
Jan 6, 2025

Conversation

sylvaingaudan
Copy link
Member

@sylvaingaudan sylvaingaudan commented Jan 3, 2025

Changes:

  • Add the possibility to include/exclude drivers when calling a process.
  • Also, list the drivers in the list of incliude / exclude, so that the client can list them on the interface
  • Add tests for exclude / include drivers

Side change:

  • refactor update_status in order to reduce code duplication

return list(map(lambda p: p.name, DriverManager.drivers[process]))

@staticmethod
def solve(process: str, ressource, include_drivers: list[str] = [], exclude_drivers: list[str] = []) -> AbstractDriver:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does resource have a type? Should be with only one s by the way

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it does not have a type: it depends on the process: ingest->url, download->item

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on s only, indeed.

@@ -88,6 +83,8 @@ def init(configuration: dict):
raise DriverException("Invalid configuration for download drivers ({})".format(configuration))
AprocProcess.input_model = InputDownloadProcess
Notifications.init()
description.inputs.get("include_drivers").schema_.items.enum = DriverManager.driver_names(summary.id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why you have to access to the properties this way, and not by just doing description.inputs.include_drivers

Copy link

sonarqubecloud bot commented Jan 6, 2025

@sylvaingaudan sylvaingaudan merged commit 006c815 into develop Jan 6, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants