Thanks, @frougon this works fine now!
mixedform text elements with spaces
Hi, This is due to a feature of the dialog program. Please always check its man page before reporting bugs: --no-collapse Normally dialog converts tabs to spaces and reduces multiple spaces to a single space for text which is displayed in a message boxes, etc. Use this option to disable that feature. Note that dialog will still wrap text, subject to the “--cr-wrap” and “--trim” options. You can pass this option either globally via Dialog.add_persistent_args() or locally using no_collapse=True: #!...
Also here all my spaces from the post are gone, so: '_' = space text = '_ Hello World!' print(text) ' ___Hello World!' But: self.d.mixedform(text, self.elements, self.height, self.width) '_Hello World!' There is a way to keep the spaces?
mixedform text elements with spaces
Home page: switch to the new https-based URL
Release 3.5.3
pythondialog messagebox grafic Bug
Hi, FYI, building dialog from source is not difficult (you may need to install a few -dev packages for its build dependencies). I just did it for the latest version, namely 1.3-20210621, with the following commands: tar -xzf dialog.tar.gz cd dialog-1.3-20210621 ./configure --prefix=/opt/dialog-1.3-20210621 --enable-nls --with-ncursesw make (actually, I added -j7 to the make command). I specified the --prefix just in case I would later do a make install, but I usually don't perform this step: for...
All right, good night. :)
Alright. Thanks for your work. I'm not going to bother trying to upgrade my dialog installation, I'll just wait for my distro to get it.
One possible explanation is that your dialog program is too old. Indeed, I tested the above with dialog 1.3-20201126, and in case I let the timeout expire, the output is: 3.5.2 ('timeout', []) True but with dialog 1.3-20190211 (on Debian buster) and pythondialog 3.5.2 too, the same test prints this: 3.5.2 ('esc', []) False So, maybe you need to upgrade dialog to make this work.
Strange indeed. The following works fine for me: import dialog d = dialog.Dialog() res = d.checklist( 'Stuff', choices=[ ('T1', 'One', 0), ('T2', 'Two', 0), ], timeout=2) print(dialog.__version__) print(res) print(res[0] == d.TIMEOUT) Are you sure you ran your test with the correct pythondialog? The above script should print the version that is being used.
Strange. I can still reproduce the problem with your updated library. $ dialog --version Version: 1.3-20190808 $ pip3 freeze | grep pythondialog pythondialog==3.5.2
pythondialog 3.5.2 is out with the changes (on PyPI.org, among others).
Update ChangeLog.init (improve some log messages)
Release 3.5.2
I will, but unfortunately, I don't think dialog supports --timeout for all widgets. So far, I've seen it work with checklist (here), msgbox (in the latest version of demo.py) and menu (quick hack on demo.py). AFAICS, it doesn't work with inputbox nor with mixedform. I haven't tested with other widgets. All this with dialog version 1.3-20201126 from Debian unstable (which suffers from this little problem...).
Great. Can you push it out as a pip update?
Commit df4f82a63c should improve support for this timeout option. I hope no widget that normally produces output is broken by the empty output in case of a timeout.
Fix related to the 'timeout' option (--timeout for dialog)
demo: add example of an msgbox with timeout
Show use of d.add_persistent_args(["--no-nl-expand"]) in examples
Timeout causes library to throw error
This is fixed in 8ffc85fc1 (the commit message uses a wrong URL for the issue, sorry).
Improve support for the --timeout dialog option
Sorry, I don't know what code worked fine in Ubuntu 18.04 because no correct code was shown here. I tried to explain that pythondialog uses dialog which writes to the terminal which is not a window system, and has no standard window system either. I don't see a way to give an “artificial border” to windows created by dialog.
Timeout causes library to throw error
Thanks for the minimal example. The Dialog.checklist() method returns Dialog.ESC because the underlying dialog program returns DIALOG_ESC. Support for DIALOG_TIMEOUT in dialog was probably added after I implemented the exit status handling. With this patch applied: diff --git a/dialog.py b/dialog.py index e6031e5..35ca74c 100644 --- a/dialog.py +++ b/dialog.py @@ -818,12 +818,14 @@ class Dialog: _DIALOG_EXTRA = 4 _DIALOG_HELP = 5 _DIALOG_ITEM_HELP = 6 + _DIALOG_TIMEOUT = 7 # cf. also _lowlevel_exit_codes...
Thank you for your quick reply. :) What I dont get is, this code works finde in Ubuntu 18.04 and even with ssh I have not this problems. Are there diffrents between the distibution, that invokes that kind of behavior? Or is there a why to give the inputbox an artificial border around it? Jep N0rbert is right with the error, but the error was on purpose to show the printlines in the blue box.
I can no longer reproduce this in a modern setup. Instead, timeouts result in an "esc" code, which also seems wrong. Example: import dialog if name == 'main': a = dialog.Dialog().checklist( 'Stuff', choices= ['T1', 'One', 0, ['T2', 'Two', 0], ], timeout=5) print(a) Run that and then just wait 5 seconds. I would expect it to say it encountered a timeout, instead I see "('esc', [])"
Dialog doesn't work with pip
Timeout causes library to throw error
Hello, Sorry for replying “a bit” late: my ISP Free.fr and SourceForge can't get along, so notification or SourceForge mailing-list emails get lost. Regarding what you wrote: 1) This is most probably related to layers below pythondialog. 2) Without a minimal example to reproduce, this report is unlikely to be of any use, I'm afraid.
pythondialog messagebox grafic Bug
Hello, You (or a command started by you, or an error triggered by you) are printing text to the terminal after a dialog call: without surprise, this prints text to the terminal. There is no window system built into the terminal that “knows” that some area must not be written to by any program. The same issue could be reproduced with dialog (no need for pythondialog), but is a bug for neither of them. If you start a program that writes to the terminal and don't want it to write to the terminal, it...
pythondialog messagebox grafic Bug
Use URLs based on HTTPS instead of HTTP when available
Minor clarification in the INSTALL file
One import statement per line
demo: remove invalid escape sequence from sample string
Update copyright years for dialog.py, demo.py, setup.py and doc/conf.py
Set development status to 'inactive'
Release 3.5.1
Use an https URL for intersphinx_mapping
Warn against potentially risky values for the executable name/path
Remove current directory from the default used when PATH is unset
Add /python2_pythondialog.egg-info/ to .gitignore
Use os.pathsep in _find_in_path() instead of hardcoding ":"
demo: remove invalid escape sequence from sample string
Switch the packaging from Distutils to Setuptools
Minor change to README.rst regarding the doc build
Minor changes
One import statement per line
Use os.pathsep in _find_in_path() instead of hardcoding ":"
Use URLs based on HTTPS instead of HTTP when available
demo: remove invalid escape sequence from sample string
README.rst: update the latest version of the Python 2 backport
Safer instruction when using easy_install
Warn against potentially risky values for the executable name/path
Remove current directory from the default used when PATH is unset
Release 3.5.1
Minor clarification in the INSTALL file
Use an https URL for intersphinx_mapping
Update copyright years for dialog.py, demo.py, setup.py and doc/conf.py
demo: remove invalid escape sequence from sample string
Switch the packaging from Distutils to Setuptools