-
Notifications
You must be signed in to change notification settings - Fork 180
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
Python CLI changes #2678
Python CLI changes #2678
Changes from all commits
cd8bbfb
075db52
8d91a38
ebd36cf
2988229
481462f
54bca48
cd33930
9f3d624
51ccc67
47fec95
b72c211
6dcfe53
935a8aa
e749fe9
a830bf4
4560880
2894b1d
294ea57
70c154e
e9393d7
913ce00
2e1efdb
ff56d40
a847938
94abafa
dda5db7
1a9759e
a22382f
7f27e89
18e6850
d511e3d
b31c9d9
7791a38
4da90a0
4c74759
ff86c44
24f1c32
6778522
a483d00
9822d58
d158891
d5a4596
4c331e2
9cee5ae
d783f8c
55929b0
db3ca00
ff983de
553a4fb
e25e977
23f436d
45738a2
2e6c28a
e98ecc6
40b7a7c
8a0d639
e384c18
7790fd3
d9587e6
8065803
be75618
08bc526
e014b24
4c9247b
f57bbd8
d6a84ba
9ce93f3
65ba856
99dd927
7115593
4095d76
05b68d5
69d3590
92f9a89
fc4b798
f34730d
2a55a43
ef5b8c5
40fdc8e
b3d98c1
4d8f766
de5ebe7
c2b2e76
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -49,6 +49,19 @@ void Pipe::unload(const Header &) { | |||||
} | ||||||
} | ||||||
|
||||||
bool Pipe::delete_piped_images = true; | ||||||
// ENVVAR name: MRTRIX_PRESERVE_TMPFILE | ||||||
// ENVVAR This variable decides whether the temporary piped image | ||||||
// ENVVAR should be preserved rather than the usual behaviour of | ||||||
// ENVVAR deletion at command completion. | ||||||
// ENVVAR For example, in case of piped commands from Python API, | ||||||
// ENVVAR it is necessary to retain the temp files until all | ||||||
// ENVVAR the piped commands are executed. | ||||||
namespace { | ||||||
bool preserve_tmpfile() { | ||||||
const char *const MRTRIX_PRESERVE_TMPFILE = getenv("MRTRIX_PRESERVE_TMPFILE"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: function is not thread safe [concurrency-mt-unsafe] const char *const MRTRIX_PRESERVE_TMPFILE = getenv("MRTRIX_PRESERVE_TMPFILE");
^ |
||||||
return (MRTRIX_PRESERVE_TMPFILE != nullptr && to<bool>(std::string(MRTRIX_PRESERVE_TMPFILE))); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: implicit conversion 'const char *' -> bool [readability-implicit-bool-conversion]
Suggested change
|
||||||
} | ||||||
} // namespace | ||||||
bool Pipe::delete_piped_images = !preserve_tmpfile(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'delete_piped_images' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables] bool Pipe::delete_piped_images = !preserve_tmpfile();
^ |
||||||
|
||||||
} // namespace MR::ImageIO |
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.
warning: function is not thread safe [concurrency-mt-unsafe]