[GRASS-dev] Re: [GRASS GIS] #1488: v.in.dxf wrapper not working

GRASS GIS trac at osgeo.org
Wed Nov 16 11:14:02 EST 2011


#1488: v.in.dxf wrapper not working
-------------------------+--------------------------------------------------
 Reporter:  cmbarton     |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  normal       |   Milestone:  7.0.0                    
Component:  wxGUI        |     Version:  svn-trunk                
 Keywords:  v.in.dxf     |    Platform:  Unspecified              
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------

Comment(by glynn):

 Replying to [comment:18 cmbarton]:

 > There are a lot of str() to look at.
 >
 > grep ' str(' *.py | wc -l
 >
 > returns 203 in gui_modules alone

 The leading space is artificially depressing that figure.

 The expressions '\<' and '\>' can be used to match the beginning and end
 of a "word". In 7.0,
 {{{
 grep '\<str(' *.py | wc -l
 }}}
 gives 294, but that isn't quite all of them, as there are some uses of
 "map(str, ...)" and similar. Using
 {{{
 grep '\<str\>' *.py | wc -l
 }}}
 finds 332, although that also includes some false positives where "str" is
 used as a variable name.

 > It looks like most of them are aimed at making sure that a text string
 instead of a number is returned.

 Using str() to create string representations of numeric values is fine.
 Converting arbitrary Python values to strings (e.g. for debugging) should
 use repr(). Conversion of unicode strings to byte strings should use the
 .encode() method.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1488#comment:19>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list