[GRASS-dev] [GRASS-SVN] r68240 - grass/trunk/scripts/v.report

2016-04-10 13:44 GMT+02:00 <svn_grass@osgeo.org>:

+ fields = line.rstrip('\r\n').split('|')

really '\r\n' ? Why not os.linesep? Ma

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa

Forgot to reply all…


Sent from my phone

---------- Forwarded message ----------
From: “Huidae Cho” <grass4u@gmail.com>
Date: Apr 11, 2016 9:54 AM
Subject: Re: [GRASS-dev] [GRASS-SVN] r68240 - grass/trunk/scripts/v.report
To: “Martin Landa” <landa.martin@gmail.com>
Cc:

That was a copy+paste from the same script, but I think \r\n is safer than os.linesep just in case v.to.db prints out \r for whatever reason. But I know that won’t happen in non-Windows anyway, so os.linesep should be fine?

11 scripts use \r\n and 5 use os.linesep. g.extension uses \r\n for reading and os.linesep for printing.

Huidae

Sent from my phone

On Apr 10, 2016 7:49 AM, “Martin Landa” <landa.martin@gmail.com> wrote:

2016-04-10 13:44 GMT+02:00 <svn_grass@osgeo.org>:

  • fields = line.rstrip(‘\r\n’).split(‘|’)

really ‘\r\n’ ? Why not os.linesep? Ma


Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa


grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

On Mon, Apr 11, 2016 at 3:57 PM, Huidae Cho <grass4u@gmail.com> wrote:
...

11 scripts use \r\n and 5 use os.linesep. g.extension uses \r\n for reading
and os.linesep for printing.

Any volunteer to homogenize that?

thanks
Markus

I don’t think we have a consensus yet…


Sent from my phone

On Apr 12, 2016 11:01 AM, “Markus Neteler” <neteler@osgeo.org> wrote:

On Mon, Apr 11, 2016 at 3:57 PM, Huidae Cho <grass4u@gmail.com> wrote:

11 scripts use \r\n and 5 use os.linesep. g.extension uses \r\n for reading
and os.linesep for printing.

Any volunteer to homogenize that?

thanks
Markus