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

Generate change type enum and resource type enum from orthanc sources #36

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

janwijbrand
Copy link
Collaborator

No description provided.

@janwijbrand janwijbrand requested a review from walcovanloon July 9, 2021 13:18
[log_event('started'), start_maintenance_cycle, show_system_info],
orthanc.ChangeType.ORTHANC_STOPPED: log_event('stopped')
types.ChangeType.ORTHANC_STOPPED: log_event('stopped')
Copy link
Collaborator

Choose a reason for hiding this comment

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

This makes the API incompatible with the one exposed by the Orthanc plugin right? Do you alias the types module somewhere to make it work at runtime?

Might be confusing for people reading Orthanc python plugin documentation and integrating associated snippets into the framework.

Copy link
Collaborator Author

@janwijbrand janwijbrand Jul 12, 2021

Choose a reason for hiding this comment

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

After thinking about this for a bit I think I understand your consideration. I've update the PR; it is much simpler now, has still the advantage of maintaining a more readable (and "updateable") enum for change type and resource type, while still maintaining "compatibility" with Orthanc's Python examples.

It also results in a reusable ChangeEvent class and no need for other nested functions (except the OnChange callback). I have the feeling this less "magical" that way and also more testable. Perhaps?

There are a few cosmetic changes that I'll address out of band.

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