[GRASS-dev] changing data for parser

Michael Barton michael.barton at asu.edu
Thu Mar 22 01:31:14 EDT 2007


menuform.py uses the xml text generated by ³<command>
‹interface-description² to create the autogenerated dialogs. This dates to
2001. 

I was just reminded in a recent post to the grass developer list that there
is a richer interface description output called by ³<command> --tcltk². This
has been developed over the past year or so. I give an example below (part
of the output from ³d.vect ‹tcltk²). We might want to consider switching the
autogenerated panels to be created by the ‹tcltk code.

Besides being a richer set of descriptions (includes prompt for notebook
tabs and color picking dialogs), it looks easier to parse than the
‹interface description xml. It would also mean that we would not need sax.

Michael

=======  --tcltk style interface description ==========

GRASS 6.3.cvs (spearfish60_test):~ > d.vect --tcltk
begin_dialog {d.vect} {
 label {}
 desc {Displays GRASS vector data in the active frame on the graphics
monitor.}
 key {display}
}
add_flag 1 {
 name {v}
 desc {Run verbosely}
 answer 0
 label {}
 guisection {}
}
add_flag 2 {
 name {a}
 desc {Get colors from map table column (of form RRR:GGG:BBB)}
 answer 0
 label {}
 guisection {Colors}
}
add_flag 3 {
 name {c}
 desc {Random colors according to category number (or layer number if
'layer=-1' is given)}
 answer 0
 label {}
 guisection {Colors}
}
add_flag 4 {
 name {i}
 desc {Use values from 'cats' option as line ID}
 answer 0
 label {}
 guisection {Query}
}
add_flag 5 {
 name {x}
 desc {Don't add to list of vectors and commands in monitor (it won't be
drawn if the monitor is refreshed)}
 answer 0
 label {}
 guisection {}
}
add_option 6 {
 name {map}
 type {name}
 multi 0
 desc {Name of input vector map}
 required 1
 options {}
 answer {}
 prompt {old,vector,vector}
 label {}
 guisection {}
}
add_option 7 {
 name {type}
 type {string}
 multi 1
 desc {Feature type(s)}
 required 0
 options {point,line,boundary,centroid,area,face}
 answer {point,line,boundary,centroid,area,face}
 prompt {}
 label {Type}
 guisection {}
}

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20070321/a5cd0055/attachment.html


More information about the grass-dev mailing list