473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Gnu/Linux dialogue boxes in python

Hi,
Okay, so I am in the mood to try this: Inform the user about what modules
the app requires in a graphical dialogue that can vary depending on what
the system already has installed. (It will fail-to output on cli)

I am running Kubuntu and I seem to have 'kdialog' installed by default (not
sure if it came as stock.)

What other 'stock' systems are there out there in the wild? Ubuntu? Suse?
Fedora? Others?

I would take a stab at wrapping them in python so that I can use the first
dialogue system found to popup messages for the user.

(Hoping, natch, that this has already been done ... ? )

\d

Nov 30 '07 #1
12 2158
On 30 Nov, 14:55, Donn Ingle <donn.in...@gmail.comwrote:
Hi,
Okay, so I am in the mood to try this: Inform the user about what modules
the app requires in a graphical dialogue that can vary depending on what
the system already has installed. (It will fail-to output on cli)

I am running Kubuntu and I seem to have 'kdialog' installed by default (not
sure if it came as stock.)
I think it's part of KDE. You can check by doing something like...

dpkg -S kdialog

That should tell you about the package which provided it, which is
possibly one of the KDE packages.
What other 'stock' systems are there out there in the wild? Ubuntu? Suse?
Fedora? Others?
There's Xdialog which is the old-fashioned graphical dialogue tool and
Zenity: the oddly named GNOME successor to gdialog. See this article
for some details:

http://www.linux.com/articles/114156
I would take a stab at wrapping them in python so that I can use the first
dialogue system found to popup messages for the user.

(Hoping, natch, that this has already been done ... ? )
I wanted to do this for the desktop module [1], but without any
obvious dialogue tool support for Windows, I didn't proceed any
further than a simple wrapping around KDialog, Zenity and Xdialog,
since the aim is to cover more than the usual UNIX-like platforms.
However, I could make that code available separately, or someone could
tell me how Windows and Mac OS X manage to perform the same tricks.
Perhaps some nasty win32 API dialogues need to be created by hand on
Windows - something which I certainly have no interest in doing, but
someone might find it exciting work.

I thought that there was another package out there which wrapped these
programs, but I can't seem to find it right now. It's certainly worth
trying to make a generic interface, though, since the features
provided by each of the programs do differ in certain important ways
which you might not care too much about if you only really care about
portability. For example, if you want to have a list of choices, I
seem to recall that KDialog offers much more flexibility than Zenity
(whose method of presenting various things is fairly awful at times),
but the lowest common denominator might well be better than reading up
on all the options for each of the programs and coding something up
yourself.

Paul

[1] http://www.python.org/pypi/desktop
Nov 30 '07 #2
Paul Boddie wrote:
I didn't proceed any
further than a simple wrapping around KDialog, Zenity and Xdialog,
since the aim is to cover more than the usual UNIX-like platforms.
However, I could make that code available separately
Thanks for the feedback and the links. I'd like to use your code (if you
don't mind! ) if it's GPL or something similar -- it may save me time.

Anyone know if zenity can be reliably assumed to be installed on a typical
Gnome desktop?

\d

Dec 1 '07 #3
[1] http://www.python.org/pypi/desktop
Oh, just saw this link and fetched the code -- will have a look around.

\d

Dec 1 '07 #4
On 1 Des, 07:02, Donn Ingle <donn.in...@gmail.comwrote:
[1]http://www.python.org/pypi/desktop

Oh, just saw this link and fetched the code -- will have a look around.
The dialogue box support isn't in the released version, but I'll
either upload a new release, or I'll make the code available
separately.

Paul
Dec 1 '07 #5
Paul Boddie wrote:
but I'll
either upload a new release, or I'll make the code available
separately.
Thanks, give me a shout when you do -- if you remember!

\d

Dec 2 '07 #6
On Fri, 30 Nov 2007 15:55:16 +0200, Donn Ingle <do********@gmail.comwrote:
Hi,
Okay, so I am in the mood to try this: Inform the user about what modules
the app requires in a graphical dialogue that can vary depending on what
the system already has installed. (It will fail-to output on cli)

I am running Kubuntu and I seem to have 'kdialog' installed by default (not
sure if it came as stock.)

What other 'stock' systems are there out there in the wild? Ubuntu? Suse?
Fedora? Others?
There are countless Unix configurations out there which can run Python.

I run Debian Linux, and I install none of that KDE or Gnome
cra^H^H^Hsoftware. Apt/dpkg uses some kind of console dialogue program
("newt"?) but that's the only thing I have.

There is no guarantee that even a modern, full-featured Unix
installation contains a dialogue application like you want.
I would take a stab at wrapping them in python so that I can use the first
dialogue system found to popup messages for the user.
But why? Either

(a) your program has a GUI and can display a dialogue box by itself
(b) your program has a GUI but has problems opening even a tiny part
of it (missing modules?), and should output diagnostics on the terminal
(c) your program is console-based, or a daemon or something, and should
not require a GUI to work.

/Jörgen

--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.dyndns.org R'lyeh wgah'nagl fhtagn!
Dec 2 '07 #7
But why? Â*Either
>
(a) your program has a GUI and can display a dialogue box by itself
(b) your program has a GUI but has problems opening even a tiny part
of it (missing modules?), and should output diagnostics on the terminal
(c) your program is console-based, or a daemon or something, and should
not require a GUI to work.
I realise those things, and it's the simplest case.

I was thinking of <a yet unknown, to me, way toallow a setup.py file to
be double-clicked and have the install start to run. When it comes to the
bit where all the import statements happen, it can popup a stock dialogue
informing the user about what they need to install first.

I was hoping to get a list of the most common, distro-installed scriptable
dialogues. Perhaps I should even look at TK -- I understand it comes
standard with Python?

Another thing to realize, and I have experienced this first-hand, is that a
bunch of text, no matter how nicely formatted, spewed out of an app in
white on black ( the usual terminal colours ) does *not* invite a user's
attention. To read it is a chore and they usually panic.

\d

Dec 2 '07 #8
On Sun, 02 Dec 2007 17:18:45 +0200, Donn Ingle <do********@gmail.comwrote:
>But why? *Either

(a) your program has a GUI and can display a dialogue box by itself
(b) your program has a GUI but has problems opening even a tiny part
of it (missing modules?), and should output diagnostics on the terminal
(c) your program is console-based, or a daemon or something, and should
not require a GUI to work.
I realise those things, and it's the simplest case.

I was thinking of <a yet unknown, to me, way toallow a setup.py file to
be double-clicked and have the install start to run. When it comes to the
bit where all the import statements happen, it can popup a stock dialogue
informing the user about what they need to install first.
But does "setup.py install" really trigger any of your code's imports?
I must admit I haven't give it much thought.

Somehow this seems like setup.py's job, and if it cannot do it maybe
someone should invent an alternative.

Or maybe it's setup.py's job to create a suitable distribution:

../setup.py --help-commands
...
bdist create a built (binary) distribution
bdist_dumb create a "dumb" built distribution
bdist_rpm create an RPM distribution
bdist_wininst create an executable installer for MS Windows

"bdist_wininst" has a very nice GUI. But I doubt that you can
make it warn for unmet dependencies.
Another thing to realize, and I have experienced this first-hand, is that a
bunch of text, no matter how nicely formatted, spewed out of an app in
white on black ( the usual terminal colours ) does *not* invite a user's
attention. To read it is a chore and they usually panic.
I have experienced it too. I have tried to understand it, and failed.
Do they read books and newspapers? They are generally not stupid.
So what you really want is a nice GUI Python installer for Linux,
which everyone can use, and which can explain to users that they need
some other packages first. Yes, that sounds like a very reasonable
thing to want.
/Jorgen

--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.dyndns.org R'lyeh wgah'nagl fhtagn!
Dec 7 '07 #9
On Nov 30, 7:55 am, Donn Ingle <donn.in...@gmail.comwrote:
Hi,
Okay, so I am in the mood to try this: Inform the user about what modules
the app requires in a graphical dialogue that can vary depending on what
the system already has installed. (It will fail-to output on cli)

I am running Kubuntu and I seem to have 'kdialog' installed by default (not
sure if it came as stock.)

What other 'stock' systems are there out there in the wild? Ubuntu? Suse?
Fedora? Others?

I would take a stab at wrapping them in python so that I can use the first
dialogue system found to popup messages for the user.

(Hoping, natch, that this has already been done ... ? )

\d
If you built a GUI with wxPython, it would just use the OS's native
dialogs unless it didn't have one and then it would use a generic
dialog. I would think creating a installer with wxPython and threads
would be fairly trivial.

Mike
Dec 7 '07 #10
On 7 Des, 17:43, kyoso...@gmail.com wrote:
>
If you built a GUI with wxPython, it would just use the OS's native
dialogs unless it didn't have one and then it would use a generic
dialog. I would think creating a installer with wxPython and threads
would be fairly trivial.
I'm not convinced that bundling a GUI component with a program which
may have no GUI elements whatsoever is easier than having a
lightweight wrapper around the spawning of a program like kdialog or
Xdialog. Of course, there's some work required in supporting dialog
program variants, mostly because the developers of these programs do
like to extend the interface and add new features and options, but
it's arguably less effort than messing around with "wxPython and
threads" (without considering the additional dependencies).

Of course, not all operating systems bundle a dialog-like program, so
perhaps there'd be a need to duplicate this functionality for some
platforms, as you suggest.

Paul
Dec 8 '07 #11
On 2 Des, 07:02, Donn Ingle <donn.in...@gmail.comwrote:
Paul Boddie wrote:
but I'll either upload a new release, or I'll make the code available
separately.

Thanks, give me a shout when you do -- if you remember!
I've now uploaded a new release of the desktop module which is now, in
fact, a package:

http://www.python.org/pypi/desktop

From release 0.3 onwards, the intention is that the desktop.dialog
module (spelled in the American way to show the connection with the
classic dialog command) will support dialogue boxes for many desktop
environments, although only X11 environments are supported so far.
There's also a desktop.windows module (no relation to the operating
system with the dubious trademark) which currently only supports
window introspection in X11 environments, but I imagine that
supporting win32 wouldn't be too difficult for those motivated enough
to look into it.

Paul
Dec 17 '07 #12
I've now uploaded a new release of the desktop module which is now, in
fact, a package:
Thanks Paul, I saw it via the cheese shop rss. I have been too busy to read
this list for a week. I will have a look in due course.

\d

Dec 19 '07 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: TimGoogler | last post by:
Does PHP have the feature to display a text or dialogue box over a text link (similar to javascript's 'onmouseover'). Ideally, I would like a simple message when the mouse is over the link...
21
by: Travis 'Bailo' Bickel | last post by:
Lately, I have been having a bear of a time trying to acquire a Linux driver for my S3/ProSavage chipset -- but that quest is now almost at an end as I have located a noble band of people who are...
8
by: Chris Markle | last post by:
When JavaScript writes out a dialogue box (like when confirm() is called) the header or title of that dialogue box shows up as "JavaScript Application"... Can this title be changed so that maybe...
12
by: Ger | last post by:
My dialogue form (sometimes partly, sometimes as a whole) remains visible during a fairly long processing job. The dialogue asks the user to enter some data for the job to follow, and after OK,...
1
by: mridulmurari | last post by:
Hey. I need help with a certain problem I'm facing in VB6. I need to display the contents of multiple items in a listview. The situation is this : Everytime i double-click on an item in a...
1
by: Sorin Schwimmer | last post by:
Hi All, After a disaster in which I lost my whole harddrive, I decided to install the newest everything that I use. I put the latest Gentoo Linux, with gcc 4.1.1, installed tcl/tk 8.4.14 and...
1
by: =?Utf-8?B?TmljVA==?= | last post by:
When clicking on a link, the relevant dialogue box appears, but sometimes for only a fraction of a second and then disappears. I then have to click on the relevant icon in the task bar and if I am...
1
by: =?Utf-8?B?SWFu?= | last post by:
I have Vista installed on a new laptop - it has never had XP. The issue I have is that dialogue boxes that appear as the normal part of a program that will sometimes not respond to the answer I...
1
by: Blackwings | last post by:
Hello, I have been toying with python, and can do some really basic things. What code is it to first of all, make a python file an exe. And what code is it to make a small popup dialogue box...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.