Dialog supports reading parameters from a file, via the '--file' option. It would be nice to have support for this option in pythondialog. This would prevent overly long command lines in the process table which, by the way, could potentially reveal sensitive information to other users.
Hello,
Thank you for the suggestion. While I don't feel much concerned with overly long command lines in this context, I agree that using --file could prevent potential information leaks.
I haven't tried yet, but from reading dialog's code, it seems to me that pythondialog could rewrite every widget call into a command using --file with a tempfile.NamedTemporaryFile. Probably as an option in case someone doesn't want these temporary files, or to ease debugging.
I'll get 3.2.2 out and see how this works.
I've looked into it and it's probably doable, but for now it is blocked by a
few dialog bugs. For instance, you can try 'dialog --file /dev/null' or --file
with a file containing:
--msgbox -- --blabla 15 20
I have preliminary patches to fix these bugs, but one of them will either break compatibility with the way backslash escapes are handled (which is currently unsatisfactory, no way to include a double quote in an argument inside the file, AFAICT) or will require a new option to activate the "correct" parsing behavior.
I am polishing the patches before I can submit them and discuss how to handle the escaping problem with the dialog maintainer, Thomas Dickey.
FYI, I sent the patches 13 days ago. The dialog maintainer told me he would look at them; I'm waiting for the final answer now.
Great. Thanks for your effort!
Good news: dialog 1.2-20150513 incorporates all patches I proposed, including the changes concerning how files included via --file are parsed (double quote and backslash handling).
Hello again,
The attached patch implements the feature. It is enabled by default but can be switched off with the pass_args_via_file keyword argument to the Dialog constructor. If it works fine for you, I'll add the missing documentation and release.
Have a nice weekend.
Attaching a new version of the patch which copes with older versions of dialog (and has more doc).
Committed to the Git repo (with doc, new 'expand_file_opt' parameter to setup_debug(), and new demo.py option to have a still-useful debug log with --debug).
https://sourceforge.net/p/pythondialog/code/
Hello,
The feature is available in pythondialog 3.3.0.
Already tested. Works like a charm. Thanks a lot!
You're welcome. Happy hacking!