[GRASS-SVN] r56963 - grass-addons/grass7/vector/v.out.png
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jul 1 11:46:38 PDT 2013
Author: annakrat
Date: 2013-07-01 11:46:38 -0700 (Mon, 01 Jul 2013)
New Revision: 56963
Modified:
grass-addons/grass7/vector/v.out.png/v.out.png.py
Log:
v.out.png: workaround to make it work with d.mon
Modified: grass-addons/grass7/vector/v.out.png/v.out.png.py
===================================================================
--- grass-addons/grass7/vector/v.out.png/v.out.png.py 2013-07-01 07:35:50 UTC (rev 56962)
+++ grass-addons/grass7/vector/v.out.png/v.out.png.py 2013-07-01 18:46:38 UTC (rev 56963)
@@ -49,36 +49,37 @@
#% answer: 480
#%end
+import os
+import sys
from grass.script import core as grass
from grass.script import gisenv
-from grass.pygrass.vector import Vector
from grass.pygrass.modules.shortcuts import display as d
-import os
-import sys
+from grass.pygrass.modules.shortcuts import general as g
def main():
- MONITOR = None
- in_vect = Vector(options['input'])
- in_vect.open()
os.environ['GRASS_RENDER_IMMEDIATE'] = 'png'
os.environ['GRASS_PNGFILE'] = options['output']
os.environ['GRASS_PNG_COMPRESSION'] = options['compression']
os.environ['GRASS_WIDTH'] = options['width']
os.environ['GRASS_HEIGHT'] = options['height']
+
+ monitor_old = None
genv = gisenv()
if 'MONITOR' in genv:
- MONITOR = genv['MONITOR']
- MONITOR_WX0_PID = genv['MONITOR_WX0_PID']
- MONITOR_wx0_CMDFILE = genv['MONITOR_wx0_CMDFILE']
- MONITOR_wx0_ENVFILE = genv['MONITOR_wx0_ENVFILE']
- MONITOR_wx0_MAPFILE = genv['MONITOR_wx0_MAPFILE']
+ monitor_old = genv['MONITOR']
+ g.gisenv(unset='MONITOR')
+
if options['rgb_column']:
- d.vect(map=in_vect.name, rgb_column=options['rgb_column'], flags='a',
+ d.vect(map=options['input'], rgb_column=options['rgb_column'], flags='a',
quiet=True)
else:
- d.vect(map=in_vect.name)
+ d.vect(map=options['input'])
+ if monitor_old:
+ g.gisenv(set='MONITOR=%s' % monitor_old)
+
+
if __name__ == "__main__":
options, flags = grass.parser()
sys.exit(main())
More information about the grass-commit
mailing list