Text Mode Interface Toolkits 9
afreeman asks: "We're currently transmogrifying some 100+ odd Python scripts into a workable sysadmin toolkit (we're also hiring another 30 or so entry-level Admins RSN), and are looking for a way to wrap everything together with a simple front end. For a variety of reasons, most of our hardware doesn't run X or a web server, which leaves text-mode interfaces. Besides curses, the most promising kits look to be UMenu, or TUI (for Perl). Any suggestions on approaches to quickly building Text Mode UIs, particularly with Python?"
Newt (Score:1)
I've worked with it a little. It doesn't do a whole lot, but what it does do, it does pretty well, and it is quite easy to use. I haven't tried to extend it so I don't know how hard it is to add new features (should that be neccesary for you.)
It can be used from Python, C, and Perl.
use HTML (Score:1)
This allows you to do forms, menus, etc, in an easy language. You can change it very quickly. There are lots of libraries around for building HTML, handling CGI forms, etc. I actually built my own, in ksh.
If you want pure-text presentation, you can use text web browsers like lynx as the UI. if you want a richer UI, you can use something like netscape navigator.
There are many other advantages. Using a web server allows you to build in secure, remote access if you want it, for free. You also get auditability
If you use a layered user model like:
Web browser
HTML form
CGI wrapper (for suid security)
command-line interface
then you can also allow command-line access to all administrative functions. This is not strictly necessary, since you can 'fake' command-line access by using something like lynx or wget, but it might be desired if you want to run admin scripts without a web server available.
Re:use HTML (Score:1)
I'm no programmer (Score:1)
Text mode toolkits I've found: (Score:1)
CDK (Curses Development Kit) - has bindings for Perl and C if I remember correctly, requires ncurses I believe
(N)Curses - which you already mentioned
dialog/whiptail/etc. - allow you to pop up interactive windows from a command line, returns results to stdout I think. IIRC, NEWT comes with whiptail?
SLang - has some embedded screen control stuff, not sure about bindings or anything else
I'm also interested in doing text-mode UI stuff with Python, so if you find a good windowing/menuing/text-displaying/etc. solution to use with Python, I'd be happy to know about it (post here I guess).
What does Redhat use? (Score:1)
Re: 1.6 curses module (Score:1)
True, but... (from the webpage) "I'm now planning to release Python 1.6 (final) around June 1st". So either the schedule slipped a bit, or it's a late beta disguised as an alpha.
Well... (Score:1)
Hmmm.. Python 1.6 betas are out now, I see. Yummy.
Re: 1.6 curses module (Score:2)
This week I checked in a relevant change; the old curses module has been replaced with a greatly expanded version that provides many ncurses features, such as colour. This means that you can no longer use the module with BSD curses implementations, but everyone has switched to SYSV curses (which is what ncurses implements), so there's no great loss except for people on really ancient platforms. The Curses HOWTO [python.org] might help, though it needs extensive updating for the new module.