[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PROPOSAL: automatic installation and configuration

On Thu, May 27, 1999 at 01:14:33PM +0300, Amos Shapira was heard to say:
> I did some more thinking about the proposed system and noticed that
> even, for instance, it is used with an X11 interface to pop-up a
> window for each question individually, it can get quite annoying to
> the user.
> Another option to do this without needing a major reorg might be to
> instruct script writers to concentrate ALL the questions as early as
> possible in the script, hopefully in one large chunk.  That way it
> might be easier to replace the entire chunk of questions with some
> database-access command (or consolidate the questions in a single GUI
> window).

  I had an interesting idea along these lines a while ago.  Unfortunately
it only made it into a Python implementation (it turned out that Python's
interactive facilities weren't really good enough for what I was trying
to do) and I never got around to rewriting it in a lower-level language.

  The idea was to make a program similar to dialog, but which would
interpret a mini-language and be abstracted around data instead of widgets.
So you might give it the following:
group foo("This is a sample group")
  string name("Name",helptext="Please enter your name.")
  boolean save("Save results",true,helptext="Select this to save the results.")

  and then a number of different frontend/backends would interpret
it.  For example, there was a GTK+ frontend which displayed each option
group as a dialog, strings as entries, booleans as checkboxes, etc and
a 'line-based' frontend which looked a lot like a shell script interaction
(the above would have come out like this:)

  This is a sample group

 Please enter your name.

 Name: Daniel Burrows

 Save results [Yn?]: ?
 Select this to save the results.
 Save results [Yn?]:

  The final output would have been configurable as well, including template
output where you'd write stuff like @name@ and a format that simply listed
all variables and their values (eg: name=Daniel Burrows)  [ in fact I
think everything up to here was implemented in the Python version, except
that I had trouble with the text-based user interaction ]

  I think this may be a better approach than simply asking for answers
because it allows both structure and distinction between different data
types (which is helpful both for writing an X11/curses interface and
because the script calling this program doesn't have to check the answers
to see if they're the correct type (theoretically) -- in fact, the template
output is probably sufficient for many situations (eg, outputting a
configuration file based on plugging in the user's answers)

  If anyone else thinks this is a good idea I'll revive the project and
start working on the C (or maybe C++) incarnation.


Whoever fights monsters should see to it that in the process he does not
become a monster.  And when you look into an abyss, the abyss also looks
into you.
		-- Friedrich Nietzsche

Reply to: