[GRASS-SVN] r57905 - grass/trunk/scripts/r.out.xyz
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Oct 1 07:10:09 PDT 2013
Author: annakrat
Date: 2013-10-01 07:10:08 -0700 (Tue, 01 Oct 2013)
New Revision: 57905
Modified:
grass/trunk/scripts/r.out.xyz/r.out.xyz.py
Log:
r.out.xyz: fix for windows (pipe problem)
Modified: grass/trunk/scripts/r.out.xyz/r.out.xyz.py
===================================================================
--- grass/trunk/scripts/r.out.xyz/r.out.xyz.py 2013-10-01 13:52:35 UTC (rev 57904)
+++ grass/trunk/scripts/r.out.xyz/r.out.xyz.py 2013-10-01 14:10:08 UTC (rev 57905)
@@ -35,14 +35,21 @@
import sys
from grass.script import core as grass
+
def main():
# if no output filename, output to stdout
output = options['output']
- if not output:
- output = '-'
+ sep = options['separator']
- ret = grass.run_command("r.stats", flags="1gn", input=options['input'],
- sep=options['separator'], output=output)
+ parameters = dict(flags="1gn",
+ input=options['input'])
+ if output:
+ parameters.update(output=output)
+ # windows don't like pipe so we don't include it in the command explicitly
+ if sep != '|':
+ parameters.update(separator=sep)
+
+ ret = grass.run_command("r.stats", **parameters)
sys.exit(ret)
if __name__ == "__main__":
More information about the grass-commit
mailing list