[GRASS-dev] [GRASS GIS] #2136: Create standard options for map or file base name (prefix)

GRASS GIS trac at osgeo.org
Tue Jun 24 08:12:15 PDT 2014


#2136: Create standard options for map or file base name (prefix)
-----------------------------------------+----------------------------------
 Reporter:  wenzeslaus                   |       Owner:  grass-dev@…              
     Type:  defect                       |      Status:  new                      
 Priority:  normal                       |   Milestone:  7.0.0                    
Component:  Parser                       |     Version:  svn-releasebranch64      
 Keywords:  base name, prefix, basename  |    Platform:  All                      
      Cpu:  All                          |  
-----------------------------------------+----------------------------------

Comment(by wenzeslaus):

 Replying to [comment:6 annakrat]:
 > Replying to [comment:4 zarch]:
 > > Replying to [comment:2 wenzeslaus]:
 > > > Moreover, documentation to the standard option would
 > > > define if underscore, dot or nothing is used to separate
 > > > basename/prefix from the suffix/result name. So, user
 > > > would know what to expect and programmer what to implement.
 > >
 > > What do you think if we use two underscore (`__`) to join the basename
 with the rest?
 > >
 > > basename`__`01, basename`__`02, etc.
 > >
 >  {{{
 >  #!python
 >  >>> import re
 >  >>> m = re.match("^(?P<name>[a-zA-Z0-9]+)__(?P<id>\w+)$",
 "horizon__000")
 >  >>> m.groups()
 >  ('horizon', '000')
 >  >>> m.groupdict()
 >  {'id': '000', 'name': 'pippo'}
 >  >>> m = re.match("^(?P<name>[a-zA-Z0-9]+)__(?P<id>\w+)$",
 "tile__000_001")
 >  >>> m.groups()
 >  ('tile', '000_001')
 >  >>> m.groupdict()
 >  {'name': 'tile', 'id': '000_001'}
 >  }}}
 > >
 > > So maybe in the future the GUI would be able to group maps following
 the rule "basename`__`*" and visualize them in the wxGUI Animation or
 something else...
 >
 > I agree with double underscore.

 I'm not sure about double underscore. I don't like how it looks like. I'm
 afraid if it will be understandable for users, for example when visualized
 in some GUI, you don't know how the font will show it (with mono spaced
 font, you can see two underscores even if they are connected with each
 other, with other fonts, you don't know). Moreover, so systems can try to
 interpret the double underscore too (see what Trac did to commit message
 in r60944).

 On the other hand, I see the advantages too. It is much harder or more
 fragile to achieve the same with one underscore (or other character).

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/2136#comment:8>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list