-
Notifications
You must be signed in to change notification settings - Fork 3
Add method to save Fiji script parameters, and add example to opening an image #111
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
base: master
Are you sure you want to change the base?
Conversation
Calls on scijava.script.ScriptModule through Python globals to access only the user-given parameters and not other variables at run-time.
The method now ignores password in a clean way, and skips some other non-essential runtime keys.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #111 +/- ##
=====================================
- Coverage 25% 25% -0%
=====================================
Files 25 25
Lines 1688 1710 +22
=====================================
+ Hits 421 422 +1
- Misses 1267 1288 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| # Skip if parameter is declared with style="password" | ||
| style = item.getWidgetStyle() | ||
| if style is not None and style.lower() == "password": | ||
| continue |
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.
You could use WidgetStyle.isStyle(ModuleItem<?> item, String target) here:
| # Skip if parameter is declared with style="password" | |
| style = item.getWidgetStyle() | |
| if style is not None and style.lower() == "password": | |
| continue | |
| # Skip if parameter is declared with style="password" | |
| if WidgetStyle.isStyle(item, TextWidget.PASSWORD_STYLE): | |
| continue |
Note also the use of public constants instead of hard-coded strings here 😉
Safe way of parsing Fiji script params by ignoring the passwords field automatically.