Skip to content

Conversation

@rohangirishrao
Copy link
Contributor

Safe way of parsing Fiji script params by ignoring the passwords field automatically.

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
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

❌ Patch coverage is 4.54545% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 25%. Comparing base (26f64c9) to head (cd9795f).

Files with missing lines Patch % Lines
src/imcflibs/imagej/misc.py 5% 21 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rohangirishrao rohangirishrao changed the title Add method to save FIji script parameters, and add example to opening an image Add method to save Fiji script parameters, and add example to opening an image Nov 7, 2025
Comment on lines +749 to +752
# Skip if parameter is declared with style="password"
style = item.getWidgetStyle()
if style is not None and style.lower() == "password":
continue
Copy link

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:

Suggested change
# 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 😉

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