-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: main
Are you sure you want to change the base?
Conversation
tests/entry_point.py
Outdated
[log_event('started'), start_maintenance_cycle, show_system_info], | ||
orthanc.ChangeType.ORTHANC_STOPPED: log_event('stopped') | ||
types.ChangeType.ORTHANC_STOPPED: log_event('stopped') |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
… orthanc python plugin examples
… orthanc python plugin examples
… orthanc python plugin examples
…h to the ChangeType and ResourceType enums
No description provided.