[GRASS-dev] Wxpython XML menudats

Glynn Clements glynn at gclements.plus.com
Mon Jan 11 19:46:07 EST 2010


Gilbert Ferrara wrote:

> I want to make a few changes into menudata.xml file (wxpython GUI). Could
> anyone point to me a wiki or a file decriptor regarging all possible tabs
> and file hierarchy.

Tabs? Or tags?

AFAIK, the only "documentation" of menudata.xml is the file which
reads it: gui/wxpython/gui_modules/menudata.py.

If it had a DTD, it would be roughly:

<!ELEMENT menudata (menubar*)>
<!ELEMENT menubar (menu*)>
<!ELEMENT menu (label, items)>
<!ELEMENT items ((separator|menuitem|menu)*)>
<!ELEMENT menuitem (label, help, keywords?, handler, command?, shortcut?)>
<!ELEMENT separator EMPTY>
<!ELEMENT label (#PCDATA)>
<!ELEMENT help (#PCDATA)>
<!ELEMENT handler (#PCDATA)>
<!ELEMENT command (#PCDATA)>
<!ELEMENT keywords (#PCDATA)>
<!ELEMENT shortcut (#PCDATA)>

Except that the order of children within menuitem elements isn't
consistent (even if this was fixed, it isn't likely to stay fixed
unless we enforced it by validating menudata.xml at build time and
treating failure as an error). Python's xml.etree.ElementTree module
doesn't do validation; it just returns a parse tree.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list