• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

doc/H03-May-2022-1,9631,207

examples/H03-May-2022-3,6802,657

pythondialog.egg-info/H03-May-2022-309226

AUTHORSH A D03-May-2022180 75

COPYINGH A D03-May-202225.9 KiB511422

COPYING.SphinxH A D03-May-20223.8 KiB10081

ChangeLogH A D03-May-202262 KiB1,7281,164

ChangeLog.initH A D03-May-202261.6 KiB1,7151,157

INSTALLH A D03-May-20225.6 KiB152111

MANIFEST.inH A D03-May-2022288 87

PKG-INFOH A D03-May-202213.9 KiB309226

README.distributorsH A D03-May-20222.9 KiB6850

README.rstH A D03-May-202210.4 KiB280198

TODOH A D03-May-202290 63

dialog.pyH A D03-May-2022152.8 KiB3,7722,781

setup.cfgH A D03-May-202269 85

setup.pyH A D03-May-20226 KiB15193

README.distributors

1-*- coding: utf-8 -*-
2
3Packaging from a release tarball
4================================
5
6Packaging from an official release tarball ("source distribution" in
7PyPA-speak[1]) should be fairly straightforward, as every source
8distribution should contain a ChangeLog file that is ready to use. The rest of
9this file mainly concerns developers and people wanting to package
10pythondialog from a clone of the Git repository.
11
12[1] https://packaging.python.org/glossary/#term-source-distribution-or-sdist
13
14
15Management of the ChangeLog file
16================================
17
18Starting from version 2.14.1, the ChangeLog file is not part of the Git
19repository anymore, because it is automatically generated from the Git log
20with the gitlog-to-changelog[2] program. But it must be present in every
21released tarball or package!
22
23  [2] https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=build-aux/gitlog-to-changelog
24
25To make this as easy as possible, setup.py does the following:
26  - create or refresh (overwriting) ChangeLog from ChangeLog.init and the Git
27    log if there is a .git subdirectory in the current directory. This is very
28    quick and done every time setup.py is run. For this to work,
29    gitlog-to-changelog must be in the PATH and executable.
30  - use the existing ChangeLog file if there is no .git subdirectory (this is
31    for people building from a release tarball as opposed to a clone of the
32    Git repository);
33  - include the ChangeLog file in every source distribution made with
34    "setup.py sdist".
35
36
37Packaging from a clone of the Git repository
38============================================
39
40If you want to prepare a package from a clone of the Git repository, you
41should:
42
43  - make sure the 'version_info' variable towards the top of dialog.py
44    indicates a Git snapshot, with something like:
45
46      version_info = VersionInfo(2, 14, 1, ".git20130930")
47
48  - install gitlog-to-changelog (single-file Perl script, see above for the
49    download location) and make sure setup.py can find it. Unless you modify
50    setup.py, this means you have to make it executable and put it somewhere
51    in your PATH. You may have to replace the first lines of shell+Perl crap
52    with a proper shebang line (such as "#! /usr/bin/perl"). You can run
53    'gitlog-to-changelog --help' to check that it is working.
54
55  - run 'setup.py sdist' to generate the ChangeLog and prepare a source
56    distribution. Alternatively, if you only want to generate the ChangeLog,
57    you can use a command such as the following, which writes its output in
58    the UTF-8 encoding:
59
60      python3 -c \
61   'import setup; setup.generate_changelog("ChangeLog", write_to_stdout=True)' \
62   >/path/to/generated/ChangeLog
63
64    If you want to do some testing of the command by piping the output into
65    a pager such as less, don't forget to type Ctrl-L to refresh the initial
66    screen, because it may be garbled due to the messages sent to stderr
67    (alternatively, you can redirect stderr).
68

README.rst

1===============================================================================
2Python wrapper for the UNIX "dialog" utility
3===============================================================================
4Easy writing of graphical interfaces for terminal-based applications
5-------------------------------------------------------------------------------
6
7Overview
8--------
9
10pythondialog is a Python wrapper for the UNIX dialog_ utility
11originally written by Savio Lam and later rewritten by Thomas E. Dickey.
12Its purpose is to provide an easy to use, pythonic and as complete as
13possible interface to dialog_ from Python code.
14
15.. _dialog: https://invisible-island.net/dialog/dialog.html
16
17pythondialog is free software, licensed under the GNU LGPL (GNU Lesser
18General Public License). Its home page is located at:
19
20  http://pythondialog.sourceforge.net/
21
22and contains a `short example`_, screenshots_, a `summary of the recent
23changes`_, links to the `documentation`_, the `Git repository`_, the
24`mailing list`_, the `issue tracker`_, etc.
25
26.. _short example:  http://pythondialog.sourceforge.net/#example
27.. _screenshots:    http://pythondialog.sourceforge.net/gallery.html
28.. _summary of the recent changes:
29                    http://pythondialog.sourceforge.net/news.html
30.. _documentation:  http://pythondialog.sourceforge.net/doc/
31.. _Git repository: https://sourceforge.net/p/pythondialog/code/
32.. _mailing list:   https://sourceforge.net/p/pythondialog/mailman/
33.. _issue tracker:  https://sourceforge.net/p/pythondialog/_list/tickets
34
35If you want to get a quick idea of what this module allows one to do,
36you can download a release tarball and run ``demo.py``::
37
38  PYTHONPATH=. python3 examples/demo.py
39
40
41What is pythondialog good for? What are its limitations?
42--------------------------------------------------------
43
44As you might infer from the name, dialog is a high-level program that
45generates dialog boxes. So is pythondialog. They allow you to build nice
46interfaces quickly and easily, but you don't have full control over the
47widgets, nor can you create new widgets without modifying dialog itself.
48If you need to do low-level stuff, you should have a look at `ncurses`_
49(cf. the ``curses`` module in the Python standard library), `blessings`_
50or slang instead. For sophisticated text-mode interfaces, the `Urwid
51Python library`_ looks rather interesting, too.
52
53.. _ncurses: https://invisible-island.net/ncurses/ncurses.html
54.. _blessings: https://github.com/erikrose/blessings
55.. _Urwid Python library: http://excess.org/urwid/
56
57
58Requirements
59------------
60
61* As of version 2.12, pythondialog requires Python 3.0 or later in the 3.x
62  series. pythondialog 3.5.2 has been tested with Python 3.9.
63
64* Versions of pythondialog up to and including 3.5.1 had a backport to
65  Python 2, however this outdated Python dialect isn't supported
66  anymore. You may find pointers to the old packages with Python 2
67  support on the `pythondialog home page`_.
68
69  .. _pythondialog home page: http://pythondialog.sourceforge.net/
70
71* Apart from that, pythondialog requires the dialog_ program (or a
72  drop-in replacement for dialog). You can download dialog from:
73
74    https://invisible-island.net/dialog/dialog.html
75
76  Note that some features of pythondialog may require recent versions of
77  dialog.
78
79
80Quick installation instructions
81-------------------------------
82
83If you have a working `pip <https://pypi.org/project/pip/>`_ setup,
84you should be able to install pythondialog with::
85
86  pip install pythondialog
87
88When doing so, make sure that your ``pip`` executable runs with the
89Python 3 installation you want to install pythondialog for.
90
91For more detailed instructions, you can read the ``INSTALL`` file from a
92release tarball. You may also want to consult the `pip documentation
93<https://pip.pypa.io/>`_.
94
95
96Documentation
97-------------
98
99The pythondialog Manual
100^^^^^^^^^^^^^^^^^^^^^^^
101
102The pythondialog Manual is written in `reStructuredText`_ format for the
103`Sphinx`_ documentation generator. The HTML documentation for the latest
104version of pythondialog as rendered by Sphinx should be available at:
105
106  http://pythondialog.sourceforge.net/doc/
107
108.. _pythondialog Manual: http://pythondialog.sourceforge.net/doc/
109.. _reStructuredText: http://docutils.sourceforge.net/rst.html
110.. _Sphinx: https://www.sphinx-doc.org/en/master/
111.. _LaTeX: https://www.latex-project.org/
112.. _Make: https://www.gnu.org/software/make/
113
114The sources for the pythondialog Manual are located in the ``doc``
115top-level directory of the pythondialog distribution, but the
116documentation build process pulls many parts from ``dialog.py`` (mainly
117docstrings).
118
119To generate the documentation yourself from ``dialog.py`` and the
120sources in the ``doc`` directory, first make sure you have `Sphinx`_ and
121`Make`_ installed. Then, you can go to the ``doc`` directory and type,
122for instance::
123
124  make html
125
126You will then find the output in the ``_build/html`` subdirectory of
127``doc``. `Sphinx`_ can build the documentation in many other formats.
128For instance, if you have `LaTeX`_ installed, you can generate the
129pythondialog Manual in PDF format using::
130
131  make latexpdf
132
133You can run ``make`` from the ``doc`` directory to see a list of the
134available formats. Run ``make clean`` to clean up after the
135documentation build process.
136
137For those who have installed `Sphinx`_ but not `Make`_, it is still
138possible to build the documentation with a command such as::
139
140  sphinx-build -b html . _build/html
141
142run from the ``doc`` directory. Please refer to `sphinx-build`_ for more
143details.
144
145.. _sphinx-build: https://www.sphinx-doc.org/en/master/man/sphinx-build.html
146
147
148Reading the docstrings from an interactive Python interpreter
149^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
150
151If you have already installed pythondialog, you may consult its
152docstrings in an interactive Python interpreter this way::
153
154   >>> import dialog; help(dialog)
155
156but only parts of the documentation are available using this method, and
157the result is much less convenient to use than the `pythondialog
158Manual`_ as generated by `Sphinx`_.
159
160
161Enabling Deprecation Warnings
162-----------------------------
163
164There are a few places in ``dialog.py`` that send a
165``DeprecationWarning`` to warn developers about obsolete features.
166However, because of:
167
168  - the dialog output to the terminal;
169  - the fact that such warnings are silenced by default since Python 2.7
170    and 3.2;
171
172you have to do two things in order to see them:
173
174  - redirect the standard error stream to a file;
175  - enable the warnings for the Python interpreter.
176
177For instance, to see the warnings produced when running the demo, you
178can do::
179
180  PYTHONPATH=. python3 -Wd examples/demo.py 2>/path/to/file
181
182and examine ``/path/to/file``. This can also help you to find files that
183are still open when your program exits.
184
185**Note:**
186
187  If your program is terminated by an unhandled exception while stderr
188  is redirected as in the preceding command, you won't see the traceback
189  until you examine the file stderr was redirected to. This can be
190  disturbing, as your program may exit with no apparent reason in such
191  conditions.
192
193For more explanations and other methods to enable deprecation warnings,
194please refer to:
195
196  https://docs.python.org/3/whatsnew/2.7.html
197
198
199Troubleshooting
200---------------
201
202If you have a problem with a pythondialog call, you should read its
203documentation and the dialog(1) manual page. If this is not enough, you
204can enable logging of shell command-line equivalents of all dialog calls
205made by your program with a simple call to ``Dialog.setup_debug()``,
206first available in pythondialog 2.12 (the ``expand_file_opt`` parameter
207may be useful in versions 3.3 and later). An example of this can be
208found in ``demo.py`` from the ``examples`` directory.
209
210As of version 2.12, you can also enable this debugging facility for
211``demo.py`` by calling it with the ``--debug`` flag (possibly combined
212with ``--debug-expand-file-opt`` in pythondialog 3.3 and later, cf.
213``demo.py --help``).
214
215
216Using Xdialog instead of dialog
217-------------------------------
218
219As far as I can tell, `Xdialog`_ has not been ported to `GTK+`_ version
2202 or later. It is not in `Debian`_ stable nor unstable (November 30, 2019).
221It is not installed on my system (because of the GTK+ 1.2 dependency),
222and according to the Xdialog-specific patches I received from Peter
223Åstrand in 2004, was not a drop-in replacement for `dialog`_ (in
224particular, Xdialog seemed to want to talk to the caller through stdout
225instead of stderr, grrrrr!).
226
227.. _Xdialog: http://xdialog.free.fr/
228.. _GTK+: https://www.gtk.org/
229.. _Debian: https://www.debian.org/
230
231All this to say that, even though I didn't remove the options to use
232another backend than dialog, nor did I remove the handful of little,
233non-invasive modifications that help pythondialog work better with
234`Xdialog`_, I don't really support the latter. I test everything with
235dialog, and nothing with Xdialog.
236
237That being said, here is the *old* text of this section (from 2004), in
238case you are still interested:
239
240  Starting with 2.06, there is an "Xdialog" compatibility mode that you
241  can use if you want pythondialog to run the graphical Xdialog program
242  (which *should* be found under http://xdialog.free.fr/) instead of
243  dialog (text-mode, based on the ncurses library).
244
245  The primary supported platform is still dialog, but as long as only
246  small modifications are enough to make pythondialog work with Xdialog,
247  I am willing to support Xdialog if people are interested in it (which
248  turned out to be the case for Xdialog).
249
250  The demo.py from pythondialog 2.06 has been tested with Xdialog 2.0.6
251  and found to work well (barring Xdialog's annoying behaviour with the
252  file selection dialog box).
253
254
255Whiptail, anyone?
256-----------------
257
258Well, pythondialog seems not to work very well with whiptail. The reason
259is that whiptail is not compatible with dialog anymore. Although you can
260tell pythondialog the program you want it to invoke, only programs that
261are mostly dialog-compatible are supported.
262
263
264History
265-------
266
267pythondialog was originally written by Robb Shecter. Sultanbek Tezadov
268added some features to it (mainly the first gauge implementation, I
269guess). Florent Rougon rewrote most parts of the program to make it more
270robust and flexible so that it can give access to most features of the
271dialog program. Peter Åstrand took over maintainership between 2004 and
2722009, with particular care for the `Xdialog`_ support. Florent Rougon
273took over maintainership again starting from 2009...
274
275..
276  # Local Variables:
277  # coding: utf-8
278  # fill-column: 72
279  # End:
280