update April 3, 2010
makemenus.py - create platform-specific .GDEmenus
files by concatenating files containing individual menu items.
Locally-installed items are automatically merged into the .GDEmenus
files. This document assumes that you are familiar with the structure
of the .GDEmenus file
as described in the GDE Manual.
create .GDEmenus files for all supported platforms and
write to files as described below. Use this form if GDE is being used
as part of a locally-installed copy of the BIRCH system
python makemenus.py - p platform
create a .GDEmenus file for the specified platform.
python makemenus.py -h
print usage message
makemenus.py works within the current working directory.
Typically, this directory is called GDE, and assumes the following
(At a BIRCH site, the GDE directory is $BIRCH/dat/GDE.)
Within GDE/makemenus/menus, the
contains menu lines and item lines. Indentation by tab characters
defines the File/Menu item hierarchy. Each menu consists of a menu line
followed by 0 or more item lines:
<menu line> ::= <menu name>
<item line> ::= <TAB><item
<menu name> is the name of a GDE menu and is also the name
of a directory in GDE/makemenus containing GDE menu items, each in a
separate file. Blanks may be included in menu names, but are
discouraged, since the menu name is also a directory name.
<item name> - Item name is the name of a GDE menu item, and is
also the name of a file containing the GDE menu item. The actual file
name must have the ".item" extension, but this extension must NOT be
used in the menulist
file. Again, blanks are permitted in item names, but are discouraged.
<platform flags> - This field consists of one or more non-blank
letters indicating the platform on which a program is available. If
this field is empty, the menu item will be included in .GDEmenus files
for all platforms. If the field is not empty, the menu item will only
be included in the specified .GDEmenus files. On a BIRCH site, when no
command line arguments are used, a
different .GDEmenus file is written for each supported platform.
The following letters may
be included in the platform flags fields:
flag for menulist
of .GDEmenus file
At login time, the user's $GDE_HELP_DIR is set to one of
these directories, so that the user gets GDE menus customized for the
platform he is currently logged into.
BIRCH - MERGING LOCAL MENU ITEMS INTO GDE
The order of menus and items displayed in GDE will be the same as
the order in menulist.
Any line on which the first non-whitespace character is a hashmark '#',
will be ignored as a comment.
Locally-installed programs that are not part of the
official BIRCH distribution can be merged into the GDE menus.
makemenus.py creates its menus in two steps. First, it reads the menulist
from GDE/makemenus/menus, and then, if it exists, reads
makemenus/ldir.parm, which contains the name of a local copy of the
makemenus directories. On a BIRCH system, this is
$BIRCH/local/dat/GDE/makemenus/menus. The structure of both of these
directories and subdirectories is identical.
If a menuitem is read from $BIRCH/local with the same name as an
item in $BIRCH, the copy in $BIRCH/local overwrites the original. This
it possible to maintain locall-modified menuitems that replace the ones
SPECIAL NOTE: DNA/RNA MENU
Several menus are hardwired into GDE. That is, in
the File, Edit and DNA/RNA, there are several internal GDE
are not specified in the .GDEmenus file. The DNA/RNA menu contains one
hardwired item, the Complement function. If we don't include a menu
DNA/RNA, this function is lost. However, it is a VERY bad idea to have
'/' character in the name of a directory. The workaround is that we
the directory DNARNA. makemenus.py will print this as 'DNA/RNA' to the
file, so that GDE correctly displays this menu.
file might include:
# multiple sequence alignment
A user logging into a Solaris system would see all items except
boxshade, while a user logging into a Linux system would see all items
except pima. Note that if the platform field is blank, then the item is
available on all platforms. In this example, putting both S and L in
platform field accomplishes the same thing.
# phylogenetic analysis
(Note: All indentation must be done using TAB characters, not blanks.
Similarly, the platform fields are separated from the item-name
fields by TABs.)
In the example, within GDE/makemenus, there must be directories called
Alignment and Phylogeny. Alignment would contain clustalx.item,
pima.item, jalview.item and boxshade.item. Phylogeny would contain
Phylip.item, fastDNAml.item and atv.item.
Locally-installed programs can be integrated into the .GDEmenus files.
For example, if $BIRCH/local/cat/GDE/makemenus/menulist contained
and there was a file called Alignment/reform.item, then the
reform program would be added to the bottom of the Alignment menu.
If none of the files listed in a menu are available
for a given platform, the .GDEmenus file for that platform will
an empty menu.
Dr. Brian Fristensky
Department of Plant Science
University of Manitoba
Winnipeg, MB Canada R3T 2N2