[GRASS-dev] [GRASS GIS] #944: menudata.py: strip out & key shortcut hint

#944: menudata.py: strip out & key shortcut hint
-----------------------------------+----------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Keywords: menudata.py, synopsis | Platform: All
      Cpu: All |
-----------------------------------+----------------------------------------
Hi,

in source:grass/trunk/wxpython/gui_modules/menudata.py
__PrintCommandsItems does not strip out "&" from the menu titles, so those
keyboard shortcut hints get propagated into the output.

see:
{{{
MDPY="$GISBASE/etc/wxpython/gui_modules/menudata.py"
python "$MDPY" commands | less
}}}

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/944&gt;
GRASS GIS <http://grass.osgeo.org>

#944: menudata.py: strip out & key shortcut hint
---------------------+------------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: menudata.py, synopsis
  Platform: All | Cpu: All
---------------------+------------------------------------------------------
Comment (by glynn):

Replying to [ticket:944 hamish]:

> in source:grass/trunk/wxpython/gui_modules/menudata.py
`__PrintCommandsItems` does not strip out "&" from the menu titles, so
those keyboard shortcut hints get propagated into the output.

Is there some reason why they should be stripped out?

AFAIK, the "commands" option only exists as a convenience for developers.
The only option which is actually used is "strings", which is used to
generate menustrings.py (for translation).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/944#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#944: menudata.py: strip out & key shortcut hint
---------------------+------------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: menudata.py, synopsis
  Platform: All | Cpu: All
---------------------+------------------------------------------------------
Comment (by hamish):

> Is there some reason why they should be stripped out?

yes, the menudata.py "commands" option is used to generate a list of all
modules and their menu position in a flat ascii file for later parsing by
the module_synopsis script. the resulting PDF and html synopses, and
furutre module man page menu location text if full of meaningless "&"s if
they aren't stripped out.

menudata.py's `__PrintCommandsItems` seems the most obvious place to do it
(as close to the source of the problem as possible), unless there are any
i18n needs etc. wheich require them to stay.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/944#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#944: menudata.py: strip out & key shortcut hint
---------------------+------------------------------------------------------
  Reporter: hamish | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: fixed | Keywords: menudata.py, synopsis
  Platform: All | Cpu: All
---------------------+------------------------------------------------------
Changes (by martinl):

  * status: new => closed
  * resolution: => fixed

Comment:

{{{
python core/menudata.py commands | grep '&' -c
0
}}}

seems to be solved. Closing, please re-open if needed.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/944#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>